diff --git a/apps/web/src/app/[lang]/lists/_components/list-form.tsx b/apps/web/src/app/[lang]/lists/_components/list-form.tsx index f4fdb0df..9ed49189 100644 --- a/apps/web/src/app/[lang]/lists/_components/list-form.tsx +++ b/apps/web/src/app/[lang]/lists/_components/list-form.tsx @@ -9,6 +9,13 @@ import { DialogTitle, DialogTrigger, } from '@plotwist/ui/components/ui/dialog' +import { + Drawer, + DrawerContent, + DrawerHeader, + DrawerTitle, + DrawerTrigger, +} from '@plotwist/ui/components/ui/drawer' import { Form, FormControl, @@ -34,9 +41,15 @@ import { getGetListsQueryKey, usePostList, usePutListId } from '@/api/list' import { useLanguage } from '@/context/language' import { type ListFormValues, listFormSchema } from './list-form-schema' -type ListFormProps = { trigger: React.ReactNode; list?: GetListById200List } +type ListFormMode = 'dialog' | 'drawer' + +type ListFormProps = { + trigger: React.ReactNode + list?: GetListById200List + mode?: ListFormMode +} -export const ListForm = ({ trigger, list }: ListFormProps) => { +export const ListForm = ({ trigger, list, mode = 'dialog' }: ListFormProps) => { const [open, setOpen] = useState(false) const { dictionary, language } = useLanguage() const { push, refresh } = useRouter() @@ -94,142 +107,167 @@ export const ListForm = ({ trigger, list }: ListFormProps) => { ) } + const Content = ( + <> +
+ + ( + + {dictionary.title} + + + + + + + + )} + /> + + ( + + {dictionary.list_form.description} + +