"use client"; import { Heart } from "lucide-react"; import { useAddFollow, useIsFollowing, useRemoveFollow } from "@/lib/hooks/useFollows"; import { cn } from "@/lib/utils"; interface FollowButtonProps { type: "bill" | "member" | "topic"; value: string; label?: string; } export function FollowButton({ type, value, label }: FollowButtonProps) { const existing = useIsFollowing(type, value); const add = useAddFollow(); const remove = useRemoveFollow(); const isFollowing = !!existing; const isPending = add.isPending || remove.isPending; const handleClick = () => { if (isFollowing && existing) { remove.mutate(existing.id); } else { add.mutate({ type, value }); } }; return ( ); }