import { zodResolver } from "@hookform/resolvers/zod"; import { t } from "@lingui/macro"; import { X } from "@phosphor-icons/react"; import { defaultProject, projectSchema } from "@reactive-resume/schema"; import { Badge, BadgeInput, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, Input, RichInput, } from "@reactive-resume/ui"; import { AnimatePresence, motion } from "framer-motion"; import { useState } from "react"; import { useForm } from "react-hook-form"; import { z } from "zod"; import { AiActions } from "@/client/components/ai-actions"; import { SectionDialog } from "../sections/shared/section-dialog"; import { URLInput } from "../sections/shared/url-input"; const formSchema = projectSchema; type FormValues = z.infer; export const ProjectsDialog = () => { const form = useForm({ defaultValues: defaultProject, resolver: zodResolver(formSchema), }); const [pendingKeyword, setPendingKeyword] = useState(""); return ( id="projects" form={form} defaultValues={defaultProject} pendingKeyword={pendingKeyword} >
( {t`Name`} )} /> ( {t`Description`} )} /> ( {t`Date or Date Range`} )} /> ( {t`Website`} )} /> ( {t`Summary`} ( )} onChange={(value) => { field.onChange(value); }} /> )} /> (
{t`Keywords`} {t`You can add multiple keywords by separating them with a comma or pressing enter.`}
{field.value.map((item, index) => ( { field.onChange(field.value.filter((v) => item !== v)); }} > {item} ))}
)} />
); };