mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-09-19 14:09:31 +02:00
feat: json pretty
This commit is contained in:
@@ -17,7 +17,7 @@ export interface ExampleCardProps<T> {
|
||||
sampleText: string;
|
||||
sampleResult: string;
|
||||
sampleOptions: T;
|
||||
changeInputResult: (newOptions: T) => void;
|
||||
changeInputResult: (newInput: string, newOptions: T) => void;
|
||||
getGroups: GetGroupsType<T>;
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ export default function ExampleCard<T>({
|
||||
<Card
|
||||
raised
|
||||
onClick={() => {
|
||||
changeInputResult(sampleOptions);
|
||||
changeInputResult(sampleText, sampleOptions);
|
||||
}}
|
||||
sx={{
|
||||
bgcolor: theme.palette.background.default,
|
||||
|
@@ -15,6 +15,7 @@ export interface ExampleProps<T> {
|
||||
exampleCards: CardExampleType<T>[];
|
||||
getGroups: GetGroupsType<T>;
|
||||
formRef: React.RefObject<FormikProps<T>>;
|
||||
setInput: React.Dispatch<React.SetStateAction<string>>;
|
||||
}
|
||||
|
||||
export default function ToolExamples<T>({
|
||||
@@ -22,9 +23,11 @@ export default function ToolExamples<T>({
|
||||
subtitle,
|
||||
exampleCards,
|
||||
getGroups,
|
||||
formRef
|
||||
formRef,
|
||||
setInput
|
||||
}: ExampleProps<T>) {
|
||||
function changeInputResult(newOptions: T) {
|
||||
function changeInputResult(newInput: string, newOptions: T) {
|
||||
setInput(newInput);
|
||||
formRef.current?.setValues(newOptions);
|
||||
const toolsElement = document.getElementById('tool');
|
||||
if (toolsElement) {
|
||||
|
Reference in New Issue
Block a user