"use client";
import { useState } from "react";
import { Play } from "lucide-react";
import { useVideoIndex } from "./VideoIndexProvider";
import { VideoPlayerModal } from "./VideoPlayerModal";
/**
* Centered play button overlay for cover images. Visible only when the
* video index has a match for this code. Same UX as the cover-grid play
* button — always visible, rectangular, opens the in-app player modal.
*/
export function CoverPlayButton({
code,
actresses,
}: {
code: string | null;
actresses?: Array<{ id: number; name: string; slug: string }>;
}) {
const idx = useVideoIndex();
const [playing, setPlaying] = useState(false);
if (!code || !idx.hasVideo(code)) return null;
return (
<>
{playing && (
setPlaying(false)}
/>
)}
>
);
}