@ -1,5 +1,5 @@
|
|||||||
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
|
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
|
||||||
import { Button, IconButton, IconHeart } from 'twenty-ui';
|
import { Button, IconButton, IconHeart, IconHeartOff } from 'twenty-ui';
|
||||||
|
|
||||||
type PageFavoriteButtonProps = {
|
type PageFavoriteButtonProps = {
|
||||||
isFavorite: boolean;
|
isFavorite: boolean;
|
||||||
@ -11,18 +11,20 @@ export const PageFavoriteButton = ({
|
|||||||
onClick,
|
onClick,
|
||||||
}: PageFavoriteButtonProps) => {
|
}: PageFavoriteButtonProps) => {
|
||||||
const title = isFavorite ? 'Remove from favorites' : 'Add to favorites';
|
const title = isFavorite ? 'Remove from favorites' : 'Add to favorites';
|
||||||
|
|
||||||
const isPageHeaderV2Enabled = useIsFeatureEnabled(
|
const isPageHeaderV2Enabled = useIsFeatureEnabled(
|
||||||
'IS_PAGE_HEADER_V2_ENABLED',
|
'IS_PAGE_HEADER_V2_ENABLED',
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{isPageHeaderV2Enabled ? (
|
{isPageHeaderV2Enabled ? (
|
||||||
<Button
|
<Button
|
||||||
Icon={IconHeart}
|
Icon={isFavorite ? IconHeartOff : IconHeart}
|
||||||
dataTestId="favorite-button"
|
dataTestId="favorite-button"
|
||||||
size="small"
|
size="small"
|
||||||
variant="secondary"
|
variant="secondary"
|
||||||
accent={isFavorite ? 'danger' : 'default'}
|
accent="default"
|
||||||
title={title}
|
title={title}
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
ariaLabel={title}
|
ariaLabel={title}
|
||||||
|
|||||||
Reference in New Issue
Block a user