* Change to using arrow functions Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: Matheus <matheus_benini@hotmail.com> * Add lint rule --------- Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: Matheus <matheus_benini@hotmail.com> Co-authored-by: Charles Bochet <charles@twenty.com>
19 lines
430 B
TypeScript
19 lines
430 B
TypeScript
import { IconButton } from '@/ui/button/components/IconButton';
|
|
import { IconHeart } from '@/ui/icon';
|
|
|
|
type OwnProps = {
|
|
isFavorite: boolean;
|
|
onClick: () => void;
|
|
};
|
|
|
|
export const PageFavoriteButton = ({ isFavorite, onClick }: OwnProps) => (
|
|
<IconButton
|
|
Icon={IconHeart}
|
|
size="medium"
|
|
variant="secondary"
|
|
data-testid="add-button"
|
|
accent={isFavorite ? 'danger' : 'default'}
|
|
onClick={onClick}
|
|
/>
|
|
);
|