import { ShareAssetType } from '@/api/asset_interfaces'; import { AppTooltip } from '@/components/ui/tooltip'; import React, { useMemo } from 'react'; import { useMemoizedFn } from '@/hooks'; import { Button } from '@/components/ui/buttons'; import { cn } from '@/lib/classMerge'; import { Star } from '@/components/ui/icons'; import { Star as StarFilled } from '@/components/ui/icons/NucleoIconFilled'; import { cva } from 'class-variance-authority'; import { useAddUserFavorite, useDeleteUserFavorite, useGetUserFavorites } from '@/api/buster_rest/users'; const favoriteStarVariants = cva('transition-colors', { variants: { variant: { default: 'text-icon-color hover:text-foreground', tertiary: 'text-text-tertiary hover:text-icon-color' }, isFavorited: { true: 'text-yellow-500! hover:text-yellow-500!', false: '' } }, defaultVariants: { variant: 'default', isFavorited: false } }); export const FavoriteStar: React.FC<{ id: string; type: ShareAssetType; title: string; className?: string; iconStyle?: 'default' | 'tertiary'; }> = React.memo(({ title: name, id, type, className = '', iconStyle = 'default' }) => { const { isFavorited, onFavoriteClick } = useFavoriteStar({ id, type, name }); const tooltipText = isFavorited ? 'Remove from favorites' : 'Add to favorites'; return (