import { useState } from "react"
import { useTranslation } from "react-i18next"
import { Button } from "@/components/ui/button"
import { cn } from "@/lib/utils"
type SpoilerVeilProps = {
content: string
/** Layout classes for the veiled text (line clamps, sizing, color). */
className?: string
}
/**
* Hides review text behind a blur with a reveal button — shown to every
* viewer, the author included. Once revealed, the text stays visible.
*/
export function SpoilerVeil({ content, className }: SpoilerVeilProps) {
const { t } = useTranslation()
const [revealed, setRevealed] = useState(false)
if (revealed) {
return {content}
}
return (
{content}
)
}