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 })} + /> + ))} +
+ ); +}