Files
feishin/src/renderer/components/item-list/item-detail-list/columns/actions-column.tsx
T
2026-02-09 21:56:08 -08:00

39 lines
1.1 KiB
TypeScript

import { ItemDetailListCellProps } from './types';
import { ActionIcon } from '/@/shared/components/action-icon/action-icon';
import { LibraryItem } from '/@/shared/types/domain-types';
export const ActionsColumn = ({ controls, internalState, song }: ItemDetailListCellProps) => {
const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {
event.stopPropagation();
event.preventDefault();
const index = internalState?.findItemIndex(song.id) ?? -1;
controls?.onMore?.({
event,
index,
internalState: internalState ?? undefined,
item: song,
itemType: LibraryItem.SONG,
});
};
const handleDoubleClick = (event: React.MouseEvent<HTMLButtonElement>) => {
event.stopPropagation();
event.preventDefault();
};
return (
<ActionIcon
icon="ellipsisHorizontal"
iconProps={{
color: 'muted',
size: 'xs',
}}
onClick={handleClick}
onDoubleClick={handleDoubleClick}
size="xs"
variant="subtle"
/>
);
};