| 6 | import { decode } from "../utils/serializer/decode"; |
| 7 | |
| 8 | export function Decoder({ |
| 9 | encoded |
| 10 | }: { |
| 11 | encoded: string; |
| 12 | searchParams: URLSearchParams; |
| 13 | }) { |
| 14 | // TODO const [state, setState] = useState(null); |
| 15 | |
| 16 | const children = useMemo(() => { |
| 17 | if (!encoded) { |
| 18 | return null; |
| 19 | } |
| 20 | |
| 21 | return decode(encoded); |
| 22 | }, [encoded]); |
| 23 | |
| 24 | // Debugging |
| 25 | // console.group("Decoder"); |
| 26 | // console.log(encoded); |
| 27 | // console.log(children); |
| 28 | // console.groupEnd(); |
| 29 | |
| 30 | return ( |
| 31 | <Box direction="column" gap={2}> |
| 32 | <div>{children}</div> |
| 33 | <Box className="p-2 overflow-auto" direction="row" gap={2} wrap> |
| 34 | TODO |
| 35 | </Box> |
| 36 | </Box> |
| 37 | ); |
| 38 | } |