fix(striker-ui): add copy icon button

This commit is contained in:
Tsu-ba-me 2024-04-05 19:36:59 -04:00
parent 60da16f6f6
commit 40d13433cf
2 changed files with 8 additions and 1 deletions

View File

@ -2,6 +2,7 @@ import {
Delete as MUIDeleteIcon,
Add as MUIAddIcon,
Close as MUICloseIcon,
ContentCopy as MUIContentCopy,
Done as MUIDoneIcon,
Edit as MUIEditIcon,
PlayCircle as MUIPlayCircleIcon,
@ -62,6 +63,10 @@ const MAP_TO_CLOSE_ICON: IconButtonMapToStateIconBundle = {
none: { iconType: MUICloseIcon },
};
const MAP_TO_COPY_ICON: IconButtonMapToStateIconBundle = {
none: { iconType: MUIContentCopy },
};
const MAP_TO_DELETE_ICON: IconButtonMapToStateIconBundle = {
none: { iconType: MUIDeleteIcon },
};
@ -86,6 +91,7 @@ const MAP_TO_MAP_PRESET: Record<
> = {
add: MAP_TO_ADD_ICON,
close: MAP_TO_CLOSE_ICON,
copy: MAP_TO_COPY_ICON,
delete: MAP_TO_DELETE_ICON,
edit: MAP_TO_EDIT_ICON,
play: MAP_TO_PLAY_ICON,
@ -132,7 +138,7 @@ const IconButton: FC<IconButtonProps> = ({
}
return result;
}, [mapToIcon, state, defaultIcon, iconProps, children]);
}, [children, defaultIcon, iconProps, mapToIcon, state]);
const iconButtonElementType = useMemo(
() => MAP_TO_VARIANT[variant],
[variant],

View File

@ -3,6 +3,7 @@ type CreatableComponent = Parameters<typeof import('react').createElement>[0];
type IconButtonPresetMapToStateIconBundle =
| 'add'
| 'close'
| 'copy'
| 'delete'
| 'edit'
| 'play'