import React from 'react' import { Spin, Transfer, TransferProps as AntdTransferProps } from 'antd' import useLocales from '../../locales' import { ProFieldOptionType } from '../../types' import useRemoteOptions from '../type-select-box/useRemoteOptions' export interface TransferProps extends AntdTransferProps { options?: ProFieldOptionType[] } export default function RemoteTransfer({ options: propOptions, ...props }: TransferProps) { const { loading, options } = useRemoteOptions(propOptions) const { t } = useLocales(({ t }) => [t]) return ( item.label} targetKeys={(props as any)?.value} locale={{ searchPlaceholder: t('form.searchHere'), }} listStyle={{ height: 266, }} {...props} dataSource={options.map((item: any) => ({ ...item, key: item?.value, // title: item?.label, // description: item?.label, }))} /> ) }