123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177 |
- import React from 'react';
- import { Button, Tooltip } from 'antd';
- import { DeleteOutlined } from '@ant-design/icons';
- import { useDispatch, useSelector } from 'react-redux';
- import { deleteWorkThunk } from '@/states/patient/worklist/slices/workSlice';
- import { FormattedMessage } from 'react-intl';
- import { AppDispatch, RootState } from '@/states/store';
- interface ActionButtonProps {
- icon: React.ReactNode;
- tooltip: React.ReactNode;
- onClick?: () => void;
- }
- const ActionButton: React.FC<ActionButtonProps> = ({
- icon,
- tooltip,
- onClick,
- }) => (
- <Tooltip title={tooltip}>
- <Button icon={icon} onClick={onClick} />
- </Tooltip>
- );
- const ActionPanel: React.FC = () => {
- const dispatch = useDispatch<AppDispatch>();
- const selectedIds = useSelector(
- (state: RootState) => state.workSelection.selectedIds
- );
- const handleDelete = () => {
- dispatch(deleteWorkThunk(selectedIds)); // Use the selected IDs from the Redux state
- };
- return (
- <div className="flex flex-wrap gap-2 w-full">
- <ActionButton
- icon={<DeleteOutlined />}
- tooltip={
- <FormattedMessage
- id="actionPanel.deleteTask"
- defaultMessage="actionPanel.deleteTask"
- />
- }
- onClick={handleDelete}
- />
- <ActionButton
- icon={<DeleteOutlined />}
- tooltip={
- <FormattedMessage
- id="actionPanel.editPatient"
- defaultMessage="actionPanel.editPatient"
- />
- }
- />
- <ActionButton
- icon={<DeleteOutlined />}
- tooltip={
- <FormattedMessage
- id="actionPanel.lockTask"
- defaultMessage="actionPanel.lockTask"
- />
- }
- />
- <ActionButton
- icon={<DeleteOutlined />}
- tooltip={
- <FormattedMessage
- id="actionPanel.risSync"
- defaultMessage="actionPanel.risSync"
- />
- }
- />
- <ActionButton
- icon={<DeleteOutlined />}
- tooltip={
- <FormattedMessage
- id="actionPanel.reRegister"
- defaultMessage="actionPanel.reRegister"
- />
- }
- />
- <ActionButton
- icon={<DeleteOutlined />}
- tooltip={
- <FormattedMessage
- id="actionPanel.saveLocal"
- defaultMessage="actionPanel.saveLocal"
- />
- }
- />
- <ActionButton
- icon={<DeleteOutlined />}
- tooltip={
- <FormattedMessage
- id="actionPanel.importXLS"
- defaultMessage="actionPanel.importXLS"
- />
- }
- />
- <ActionButton
- icon={<DeleteOutlined />}
- tooltip={
- <FormattedMessage
- id="actionPanel.sortList"
- defaultMessage="actionPanel.sortList"
- />
- }
- />
- <ActionButton
- icon={<DeleteOutlined />}
- tooltip={
- <FormattedMessage
- id="actionPanel.cloudShare"
- defaultMessage="actionPanel.cloudShare"
- />
- }
- />
- <ActionButton
- icon={<DeleteOutlined />}
- tooltip={
- <FormattedMessage
- id="actionPanel.imageExchange"
- defaultMessage="actionPanel.imageExchange"
- />
- }
- />
- <ActionButton
- icon={<DeleteOutlined />}
- tooltip={
- <FormattedMessage
- id="actionPanel.qrPrint"
- defaultMessage="actionPanel.qrPrint"
- />
- }
- />
- <ActionButton
- icon={<DeleteOutlined />}
- tooltip={
- <FormattedMessage
- id="actionPanel.send"
- defaultMessage="actionPanel.send"
- />
- }
- />
- <ActionButton
- icon={<DeleteOutlined />}
- tooltip={
- <FormattedMessage
- id="actionPanel.burn"
- defaultMessage="actionPanel.burn"
- />
- }
- />
- <ActionButton
- icon={<DeleteOutlined />}
- tooltip={
- <FormattedMessage
- id="actionPanel.export"
- defaultMessage="actionPanel.export"
- />
- }
- />
- <ActionButton
- icon={<DeleteOutlined />}
- tooltip={
- <FormattedMessage
- id="actionPanel.import"
- defaultMessage="actionPanel.import"
- />
- }
- />
- </div>
- );
- };
- export default ActionPanel;
|