|
|
|
|
|
|
|
|
iconFontSize?: number; |
|
|
iconFontSize?: number; |
|
|
items?: MenuProps['items']; |
|
|
items?: MenuProps['items']; |
|
|
height?: number; |
|
|
height?: number; |
|
|
|
|
|
needsDeletionValidation?: boolean; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const OperateDropdown = ({ |
|
|
const OperateDropdown = ({ |
|
|
|
|
|
|
|
|
iconFontSize = 30, |
|
|
iconFontSize = 30, |
|
|
items: otherItems = [], |
|
|
items: otherItems = [], |
|
|
height = 24, |
|
|
height = 24, |
|
|
|
|
|
needsDeletionValidation = true, |
|
|
}: React.PropsWithChildren<IProps>) => { |
|
|
}: React.PropsWithChildren<IProps>) => { |
|
|
const { t } = useTranslation(); |
|
|
const { t } = useTranslation(); |
|
|
const showDeleteConfirm = useShowDeleteConfirm(); |
|
|
const showDeleteConfirm = useShowDeleteConfirm(); |
|
|
|
|
|
|
|
|
const handleDelete = () => { |
|
|
const handleDelete = () => { |
|
|
showDeleteConfirm({ onOk: deleteItem }); |
|
|
|
|
|
|
|
|
if (needsDeletionValidation) { |
|
|
|
|
|
showDeleteConfirm({ onOk: deleteItem }); |
|
|
|
|
|
} else { |
|
|
|
|
|
deleteItem(); |
|
|
|
|
|
} |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
const handleDropdownMenuClick: MenuProps['onClick'] = ({ domEvent, key }) => { |
|
|
const handleDropdownMenuClick: MenuProps['onClick'] = ({ domEvent, key }) => { |