import { Flame } from "lucide-react"; import type { TopicTrend } from "../../../shared/api/client"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, ScrollArea, } from "../../../shared/ui"; interface TopicListProps { topics: TopicTrend[]; loading: boolean; } const TOPIC_COLORS = [ "from-primary to-sky-300", "from-accent to-pink-300", "from-orange-400 to-yellow-300", "from-emerald-400 to-teal-300", "from-violet-400 to-purple-300", ]; export function TopicList({ topics, loading }: TopicListProps) { if (loading && !topics?.length) return ; if (!topics?.length) { return ( Topik akan muncul setelah AI selesai menganalisis. ); } const maxCount = Math.max(...topics.map((t) => t.count), 1); return ( Topik Trending Yang paling ramai dibicarakan. {topics.map((topic, i) => { const colorClass = TOPIC_COLORS[i % TOPIC_COLORS.length]; return ( {i + 1} {topic.topic} {topic.count} ); })} ); } function LoadingBox() { return ( Memuat data... ); }