import { Input, SearchableDropdown } from '@ballerine/ui'; import { CheckIcon, Loader2 } from 'lucide-react'; import { Button } from '@/common/components/atoms/Button/Button'; import { Dialog } from '@/common/components/organisms/Dialog/Dialog'; import { DialogContent } from '@/common/components/organisms/Dialog/Dialog.Content'; import { DialogHeader } from '@/common/components/organisms/Dialog/Dialog.Header'; import { DialogTrigger } from '@/common/components/organisms/Dialog/Dialog.Trigger'; import { Form } from '@/common/components/organisms/Form/Form'; import { FormControl } from '@/common/components/organisms/Form/Form.Control'; import { FormField } from '@/common/components/organisms/Form/Form.Field'; import { FormItem } from '@/common/components/organisms/Form/Form.Item'; import { FormLabel } from '@/common/components/organisms/Form/Form.Label'; import { FormMessage } from '@/common/components/organisms/Form/Form.Message'; import { useCustomerQuery } from '@/domains/customer/hooks/queries/useCustomerQuery/useCustomerQuery'; import { useCreateKybAndOwnershipAssessmentDialogLogic } from './hooks/useCreateKybAndOwnershipAssessmentDialogLogic'; import { Select } from '@/common/components/atoms/Select/Select'; import { SelectValue } from '@/common/components/atoms/Select/Select.Value'; import { SelectTrigger } from '@/common/components/atoms/Select/Select.Trigger'; import { SelectContent } from '@/common/components/atoms/Select/Select.Content'; import { SelectGroup } from '@/common/components/atoms/Select/Select.Group'; import { SelectItem } from '@/common/components/atoms/Select/Select.Item'; import { getCountries, getCountryStates } from '@ballerine/common'; import { ctw } from '@/common/utils/ctw/ctw'; type CreateKybAndOwnershipAssessmentDialogProps = { open: boolean; toggleOpen: (val?: boolean) => void; disabled?: boolean; trigger: React.ReactNode; }; export const CreateKybAndOwnershipAssessmentDialog = ({ disabled, trigger, open, toggleOpen: toggleOpenProps, }: CreateKybAndOwnershipAssessmentDialogProps) => { const { form, showSuccess, isSubmitting, onSubmit, toggleOpen } = useCreateKybAndOwnershipAssessmentDialogLogic({ toggleOpen: toggleOpenProps }); return ( {trigger}

Create a KYB & Ownership Case

{showSuccess ? ( ) : ( )}
); }; const CreateKybAndUboCheckDialogSuccessContent = () => { const { data: customer } = useCustomerQuery(); const isDemoAccount = customer?.config?.isDemoAccount; return (

Your KYB & Ownership check is being generated.

{isDemoAccount &&

Ready in up to 24 hours

} Your case is being generated.
); }; type CreateKybAndUboCheckDialogFormContentProps = Pick< ReturnType, 'form' | 'onSubmit' | 'isSubmitting' >; const CreateKybAndUboCheckDialogFormContent = ({ form, onSubmit, isSubmitting, }: CreateKybAndUboCheckDialogFormContentProps) => { return (
( Company Name )} /> ( Registration Number )} /> { const countries = getCountries('en'); const availableCountries = countries.map(country => ({ value: country.const as string, label: country.title as string, })); return ( Country
); }} /> {form.watch('country') === 'US' && ( { const selectedCountry = form.watch('country'); const states = selectedCountry ? getCountryStates(selectedCountry) : []; const availableStates = states.map(state => ({ value: state.isoCode, label: state.name, })); const hasStates = availableStates.length > 0; return ( State/Province
); }} /> )} ( Correlation ID (Optional) )} />
); };