"use client"; import { useState } from "react"; import { CARD_META, CARD_TYPES, shouldShowHistoricalAccuracy, type CardType, } from "@/lib/cards"; import { CardContent } from "./cards/CardContent"; import { InfoCard } from "./InfoCard"; export function MovieInsightPanel({ movieId, genres, }: { movieId: number; genres: string[]; }) { const visibleCards = CARD_TYPES.filter((type) => { if (type === "historical_accuracy") { return shouldShowHistoricalAccuracy(genres); } return true; }); const [selected, setSelected] = useState(visibleCards[0]); return (
{visibleCards.map((type) => ( setSelected(type)} /> ))}
); }