Migrate to a monorepo structure (#2909)
This commit is contained in:
@ -0,0 +1,33 @@
|
||||
import { useRecoilState } from 'recoil';
|
||||
|
||||
import { useDeleteOneRecord } from '@/object-record/hooks/useDeleteOneRecord';
|
||||
import { IconTrash } from '@/ui/display/icon';
|
||||
import { LightIconButton } from '@/ui/input/button/components/LightIconButton';
|
||||
import { isRightDrawerOpenState } from '@/ui/layout/right-drawer/states/isRightDrawerOpenState';
|
||||
|
||||
type ActivityActionBarProps = {
|
||||
activityId: string;
|
||||
};
|
||||
|
||||
export const ActivityActionBar = ({ activityId }: ActivityActionBarProps) => {
|
||||
const [, setIsRightDrawerOpen] = useRecoilState(isRightDrawerOpenState);
|
||||
const { deleteOneRecord: deleteOneActivity } = useDeleteOneRecord({
|
||||
objectNameSingular: 'activity',
|
||||
refetchFindManyQuery: true,
|
||||
});
|
||||
|
||||
const deleteActivity = () => {
|
||||
deleteOneActivity?.(activityId);
|
||||
|
||||
setIsRightDrawerOpen(false);
|
||||
};
|
||||
|
||||
return (
|
||||
<LightIconButton
|
||||
Icon={IconTrash}
|
||||
onClick={deleteActivity}
|
||||
accent="tertiary"
|
||||
size="medium"
|
||||
/>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user