///
export interface FormRecord {
form_id: number;
id: number;
main_field: string;
data?: {
[key: string]: any;
};
}
export interface ClientData {
id: number;
display_name: string;
created_at: string;
phone: string;
email: string;
channel: string;
country_calling_code: string;
nickname: string;
shop_id: number;
updated_at: string;
contacts_info: {
value: {
first_name?: string;
last_name?: string;
phone?: {
phone?: string;
country_calling_code?: string;
country_code?: string;
};
email?: string;
};
};
form_record: FormRecord[];
}
export interface ClientSearchProps {
dataSource?: any;
isShowScanner?: boolean;
isShowCamera?: boolean;
isShowNFC?: boolean;
isShowNewButton?: boolean;
newButtonAlign?: 'left' | 'center' | 'right';
newButtonText?: string;
renderType?: 'modal' | 'drawer' | 'portal' | '';
containerProps?: Record;
isShowSearch?: boolean;
isShowSearchCamera?: boolean;
searchIcon?: string;
placeholder?: string;
isShowSearchButton?: boolean;
resultSort?: 'asc' | 'desc' | 'custom';
sortBy?: string;
style?: React.CSSProperties;
onChange?: (value: string) => void;
onSearch?: (value: string) => void;
onAdd?: () => void;
onDataChange?: (data: any) => void;
onRowClick?: (record: ClientData, index: number) => void;
}
export interface ClientFormData {
display_name: string;
phone?: string;
email?: string;
nickname?: string;
}
export interface ClientSearchState {
modalVisible: boolean;
loading: boolean;
searchResults: ClientData[];
searchValue: string;
}