import { useForm } from 'react-hook-form' import { zodResolver } from '@hookform/resolvers/zod' import { ProcessorLinkCreateSchema } from '@lunarfront/shared/schemas' import type { ProcessorLinkCreateInput } from '@lunarfront/shared/schemas' import { Button } from '@/components/ui/button' import { Input } from '@/components/ui/input' import { Label } from '@/components/ui/label' import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select' interface ProcessorLinkFormProps { accountId: string onSubmit: (data: Record) => void loading?: boolean } export function ProcessorLinkForm({ accountId, onSubmit, loading }: ProcessorLinkFormProps) { const { register, handleSubmit, setValue, watch, formState: { errors }, } = useForm({ resolver: zodResolver(ProcessorLinkCreateSchema), defaultValues: { accountId, processor: 'stripe', processorCustomerId: '', }, }) const processor = watch('processor') return (
{errors.processorCustomerId && (

{errors.processorCustomerId.message}

)}
) }