mirror of
https://github.com/twentyhq/twenty.git
synced 2025-01-03 17:53:58 +03:00
parent
afd3252cbe
commit
90d47a8fca
@ -1,5 +1,5 @@
|
||||
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
|
||||
import { Button, IconButton, IconHeart } from 'twenty-ui';
|
||||
import { Button, IconButton, IconHeart, IconHeartOff } from 'twenty-ui';
|
||||
|
||||
type PageFavoriteButtonProps = {
|
||||
isFavorite: boolean;
|
||||
@ -11,18 +11,20 @@ export const PageFavoriteButton = ({
|
||||
onClick,
|
||||
}: PageFavoriteButtonProps) => {
|
||||
const title = isFavorite ? 'Remove from favorites' : 'Add to favorites';
|
||||
|
||||
const isPageHeaderV2Enabled = useIsFeatureEnabled(
|
||||
'IS_PAGE_HEADER_V2_ENABLED',
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
{isPageHeaderV2Enabled ? (
|
||||
<Button
|
||||
Icon={IconHeart}
|
||||
Icon={isFavorite ? IconHeartOff : IconHeart}
|
||||
dataTestId="favorite-button"
|
||||
size="small"
|
||||
variant="secondary"
|
||||
accent={isFavorite ? 'danger' : 'default'}
|
||||
accent="default"
|
||||
title={title}
|
||||
onClick={onClick}
|
||||
ariaLabel={title}
|
||||
|
Loading…
Reference in New Issue
Block a user