import React from 'react'; import { Drawer } from '@arco-design/web-react'; import type { FieldHandler } from '../fields'; import { EditForm } from '../edit/EditForm'; import type { ViewType } from '../../context/viewtype'; import { useEvent } from '../../hooks/useEvent'; import { DetailForm } from '../detail/DetailForm'; import type { BasicRecord } from '../../api/types'; import { useTranslation } from 'react-i18next'; export interface ListTableDrawerProps { visible: boolean; onChangeVisible: (visible: boolean) => void; fields: FieldHandler[]; record: BasicRecord | null; viewType: ViewType; /** * Drawer width * @default 680 */ width?: number; } export const ListTableDrawer: React.FC = React.memo( (props) => { const { t } = useTranslation(); const hide = useEvent(() => { props.onChangeVisible(false); }); return ( {props.viewType === 'edit' ? ( ) : ( )} ); } ); ListTableDrawer.displayName = 'ListTableDrawer';