'use client' import { CheckIcon, CopyIcon, InfoIcon } from 'lucide-react' import Image from 'next/image' import { useCallback, useEffect, useRef, useState } from 'react' import { WhatsAppIcon } from '@/components/socialIcons' import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/Popover' import { copyFeedbackLabels, copyFeedbackLiveMessages, useCopyFeedback } from '@/lib/copyFeedback' import { buildRadioShareWhatsAppUrl, JINGLE_PLAY_EVENT, RADIO_CONNECT_TIMEOUT_MS, RADIO_PAGE_URL, RADIO_PLAY_EVENT, RADIO_SHARE_MESSAGE, RADIO_STREAM_URL, RADIO_TITLE, } from '@/lib/radio' import { cn } from '@/lib/utils' import { JINGLE_FOCUS_RING } from './focusRing' type RadioStatus = 'idle' | 'connecting' | 'playing' | 'error' const PLAY_CONTROL = cn( 'inline-flex size-12 flex-none items-center justify-center rounded-full bg-(--pt-yellow) text-(--pt-yellow-ink) md:size-14', 'shadow-[0_6px_0_#cfb900,0_10px_22px_rgb(0_0_0/15%)] transition-[transform,box-shadow,filter,opacity] duration-150 ease-out', 'hover:-translate-y-0.5 hover:brightness-[0.98] hover:shadow-[0_8px_0_#cfb900,0_12px_24px_rgb(0_0_0/18%)]', 'active:translate-y-[3px] active:shadow-[0_3px_0_#cfb900]', 'motion-reduce:transition-none motion-reduce:hover:translate-y-0', JINGLE_FOCUS_RING, ) const SHARE_OUTLINE = cn( 'inline-flex min-h-11 items-center justify-center gap-2 rounded-[10px] border-[1.5px] border-[rgb(162_28_28/32%)] bg-transparent px-3.5', 'font-[family-name:var(--font-exo2)] text-sm font-extrabold text-(--pt-red) no-underline', 'transition-colors duration-150 ease-out hover:border-(--pt-red) hover:bg-[rgb(162_28_28/7%)] motion-reduce:transition-none', JINGLE_FOCUS_RING, ) const SHARE_LINK = cn( 'inline-flex min-h-11 items-center gap-2 rounded-lg px-2 text-sm font-bold text-(--pt-red)', JINGLE_FOCUS_RING, ) const SHARE_PRIMARY = cn( 'inline-flex min-h-11 items-center justify-center gap-2 rounded-lg bg-(--pt-red) px-4 text-sm font-black text-white no-underline', 'font-[family-name:var(--font-exo2)] transition-[filter] duration-150 ease-out hover:brightness-110 motion-reduce:transition-none', JINGLE_FOCUS_RING, ) const RETRY_CONTROL = cn( 'inline-flex min-h-11 items-center rounded-lg bg-(--pt-red) px-4 text-sm font-black text-white', 'font-[family-name:var(--font-exo2)] transition-[filter] duration-150 ease-out hover:brightness-110 motion-reduce:transition-none', JINGLE_FOCUS_RING, ) const ZENO_LINK = cn( 'inline-flex min-h-11 items-center rounded-lg px-2 text-sm font-bold text-(--pt-red) underline underline-offset-4', JINGLE_FOCUS_RING, ) const PlayIcon = () => ( ) const PauseIcon = () => ( ) const ShareIcon = ({ className }: { className: string }) => ( ) /** * S25 (Cena 05) — the radio share control: one discreet trigger with the two * approved exits (the literal message into the sender's own WhatsApp, or the * message copied to the clipboard with the shared feedback). The copy writes * the literal, link included — what circulates is the message, matching the * gate's box. Private to this file: the radio owns its share surface. */ const RadioShareControl = ({ variant }: { variant: 'outline' | 'link' }) => { const [open, setOpen] = useState(false) const { feedback, copy } = useCopyFeedback() return (

Compartilhar a rádio

{RADIO_SHARE_MESSAGE}

setOpen(false)} > Compartilhar no WhatsApp
{copyFeedbackLiveMessages[feedback]}
) } /** * S25 — the home radio player (artefato: cenas 01–05). The zeno.fm iframe of * S24 is gone: this client component owns a bare `