diff --git a/example-client/src/routes/rooms/$id.tsx b/example-client/src/routes/rooms/$id.tsx index 1605b87..c5b5855 100644 --- a/example-client/src/routes/rooms/$id.tsx +++ b/example-client/src/routes/rooms/$id.tsx @@ -1,40 +1,39 @@ -import { Button, Textarea } from '@mantine/core'; +import { Button, Divider, Textarea } from '@mantine/core'; import { createFileRoute } from '@tanstack/react-router'; import { useRef } from 'react'; import { meta } from '~client/form/form-config'; import { DetailHeader } from '~client/form/lib/detail-header'; import MantineZenstackUpdateForm from '~client/form/lib/mantine-update-form'; -import type { ZenstackFormRef } from '~zenstack-ui/index'; +import { type ZenstackFormRef } from '~zenstack-ui/index'; export const Route = createFileRoute('/rooms/$id')({ component: PeopleDetail, }); -// Override metadata to hide the aiSummary field -const metadataOverride = JSON.parse(JSON.stringify(meta)); -metadataOverride.models.room.fields.aiSummary.hidden = true; - function PeopleDetail() { const params = Route.useParams() as { id: string }; const id = Number(params.id); + // Example of useRef to get the form const formRef = useRef(null); - const form = formRef.current?.form; - - const handleSomeAction = () => { - formRef.current?.form.reset(); - }; return (
- -