import { Card, CardContent } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; import { useState } from "react"; import ProfileModal from "./ProfileModal"; import type { MediaOutlet } from "@shared/schema"; interface MediaOutletCardProps { outlet: MediaOutlet; viewMode?: "grid" | "list"; } export default function MediaOutletCard({ outlet, viewMode = "list" }: MediaOutletCardProps) { const [showProfile, setShowProfile] = useState(false); const handleCardClick = () => { window.location.href = `/media/${outlet.slug}`; }; const handleInfoClick = (e: React.MouseEvent) => { e.stopPropagation(); setShowProfile(true); }; const getOutletImage = () => { if (outlet.imageUrl) { // Handle @assets/ paths if (outlet.imageUrl.startsWith('@assets/')) { // Convert @assets/ to a proper import path or static asset path return outlet.imageUrl.replace('@assets/', '/attached_assets/'); } return outlet.imageUrl; } // Default images based on category if (outlet.category === "People") { return "https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?ixlib=rb-4.0.3&w=64&h=64&fit=crop&crop=face"; } else if (outlet.category === "Companies") { return null; // Use initial letter } return null; }; const getOutletIcon = () => { if (outlet.category === "Topics") { return outlet.name.toLowerCase().includes("crypto") ? "fas fa-coins" : outlet.name.toLowerCase().includes("ai") ? "fas fa-brain" : outlet.name.toLowerCase().includes("federal") ? "fas fa-university" : "fas fa-hashtag"; } return "fas fa-building"; }; const getTagColor = () => { const tag = outlet.tags?.[0] || outlet.category; const colors = { "Tech Leader": "bg-blue-100 text-blue-800", "CEO": "bg-purple-100 text-purple-800", "Crypto": "bg-yellow-100 text-yellow-800", "Politics": "bg-red-100 text-red-800", "AI": "bg-green-100 text-green-800", "Finance": "bg-indigo-100 text-indigo-800", "Blockchain": "bg-cyan-100 text-cyan-800", "Economy": "bg-orange-100 text-orange-800", "Football": "bg-emerald-100 text-emerald-800" }; return colors[tag as keyof typeof colors] || "bg-gray-100 text-gray-800"; }; return ( <> {/* Clean List Style like screenshots */}
{outlet.description}