feat: json pretty

This commit is contained in:
Ibrahima G. Coulibaly
2025-02-27 13:05:38 +00:00
parent 18c305ac9b
commit d2eb7030d8
12 changed files with 78 additions and 49 deletions

View File

@@ -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) {