"use client";
import { useState, type ButtonHTMLAttributes } from "react";
import "./heart-burst.css";
/**
* Heart Burst
* A like button with one good moment: the heart pops in red, a ring blooms out, a few sparks
* fly, and the count rolls up a digit. Unliking is quiet — the heart just empties.
*/
type Props = Omit, "onChange"> & {
liked?: boolean;
defaultLiked?: boolean;
count?: number;
onChange?: (liked: boolean) => void;
label?: string;
};
const SPARKS = ["#ff4d6d", "#ffb703", "#7c5cff", "#2ec4b6", "#ff4d6d", "#ffb703", "#2ec4b6"];
export function HeartBurst({ liked, defaultLiked = false, count = 0, onChange, label = "Like", className = "", ...rest }: Props) {
const [inner, setInner] = useState(defaultLiked);
const on = liked ?? inner;
const [beat, setBeat] = useState(0);
const n = count + (on ? 1 : 0);
return (
);
}