import { useForm } from 'react-hook-form' import { zodResolver } from '@hookform/resolvers/zod' import { PaymentMethodCreateSchema } from '@lunarfront/shared/schemas' import type { PaymentMethodCreateInput } 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 PaymentMethodFormProps { accountId: string onSubmit: (data: Record) => void loading?: boolean } export function PaymentMethodForm({ accountId, onSubmit, loading }: PaymentMethodFormProps) { const { register, handleSubmit, setValue, watch, formState: { errors }, } = useForm({ resolver: zodResolver(PaymentMethodCreateSchema), defaultValues: { accountId, processor: 'stripe', processorPaymentMethodId: '', isDefault: false, }, }) const processor = watch('processor') return (
{errors.processorPaymentMethodId && (

{errors.processorPaymentMethodId.message}

)}
) }