Files
twenty/front/src/modules/ui/data-table/table-cell/components/TableCellButton.tsx
Thaïs 7af306792b feat: add Table and TableSection components (#1849)
* refactor: rename ui/table to ui/data-table

* feat: add Table and TableSection components

Closes #1806
2023-10-04 17:46:14 +02:00

27 lines
739 B
TypeScript

import styled from '@emotion/styled';
import { motion } from 'framer-motion';
import { FloatingIconButton } from '@/ui/button/components/FloatingIconButton';
import { IconComponent } from '@/ui/icon/types/IconComponent';
const StyledEditButtonContainer = styled(motion.div)`
position: absolute;
right: 5px;
`;
type TableCellButtonProps = {
onClick?: () => void;
Icon: IconComponent;
};
export const TableCellButton = ({ onClick, Icon }: TableCellButtonProps) => (
<StyledEditButtonContainer
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
transition={{ duration: 0.1 }}
whileHover={{ scale: 1.04 }}
>
<FloatingIconButton size="small" onClick={onClick} Icon={Icon} />
</StyledEditButtonContainer>
);