"use client"; import { useCallback, useState } from "react"; import { toolGroups } from "@/config/tools"; import { safeJsonParse } from "@/lib/json"; import { Editor, EditorProps } from "@/components/ui/editor"; import * as Select from "@/components/ui/select"; import * as Button from "@/components/buttons"; import { Configuration } from "@/components/configuration"; import { Configurations } from "@/components/configurations"; import { ControlMenu } from "@/components/control-menu"; import * as icons from "@/components/icons"; import { PageRootSection } from "@/components/page-root-section"; import { PageSection } from "@/components/page-section"; const indentations = { two: " ", four: " ", zero: "", tab: "\t", }; export default function Page() { const [indentation, setIndentation] = useState(indentations.two); const [input, setInput] = useState('{\n"foo":"bar"\n}'); const parsed = safeJsonParse(input); const output = parsed.map(x => JSON.stringify(x, null, indentation)).unwrapOr(""); const clearInput = useCallback(() => setInput(""), []); const onJsonChange: EditorProps["onChange"] = value => setInput(value ?? ""); const indentationConfig = ( } title="Indentation" control={ 2 spaces 4 spaces 1 tab minified } /> ); const inputPasteButton = ; const inputFileButton = ( ); const inputClearButton = ; const outputCopyButton = ; const inputControl = ; const outputControl = ; return (
); }