From f852782c6caf94f1296fe23ca3840d9732642553 Mon Sep 17 00:00:00 2001 From: rajun Date: Tue, 27 Oct 2026 16:28:51 +0530 Subject: [PATCH] feat: add AR page layout switches to the project form --- .../projects/form/ar-page-fields.tsx | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 app/components/projects/form/ar-page-fields.tsx diff --git a/app/components/projects/form/ar-page-fields.tsx b/app/components/projects/form/ar-page-fields.tsx new file mode 100644 index 0000000..50431dd --- /dev/null +++ b/app/components/projects/form/ar-page-fields.tsx @@ -0,0 +1,32 @@ +import { useId } from 'react'; +import { useFormContext, useWatch } from 'react-hook-form'; +import { SwitchRow } from '~/components/ui/switch-row'; +import { Text } from '~/components/ui/text'; +import { AR_PAGE_TOGGLES } from '~/data/projects/constants'; +import type { ProjectFormValues } from '~/schemas/projects/project-form'; + +// What the client's AR page shows around the model +export function ArPageFields() { + const headingId = useId(); + const { control, setValue } = useFormContext(); + const arPage = useWatch({ control, name: 'arPage' }); + + return ( +
+ + AR page + + {AR_PAGE_TOGGLES.map(({ key, label, hint }) => ( + setValue(`arPage.${key}`, checked, { shouldDirty: true })} + /> + ))} +
+ ); +}