"use client"; import Link from "next/link"; import type { GameNpc } from "@/payload-types"; import { Badge } from "@/components/ui/badge"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; interface NpcCardProps { readonly npc: GameNpc; } export function NpcCard({ npc }: NpcCardProps) { const factionName = typeof npc.faction === "object" && npc.faction !== null ? npc.faction.name : null; return ( {npc.name} {npc.occupation ?? "Occupation not recorded"} {npc.isInGame === true && ( In Game )} {npc.isGenerated === true && ( Generated )} {npc.vendor?.enabled === true && ( Vendor )} Faction {factionName ?? "Unaffiliated"} ); }
{npc.occupation ?? "Occupation not recorded"}