diff --git a/src/components/frontend/dashboard/ActiveCampaigns.tsx b/src/components/frontend/dashboard/ActiveCampaigns.tsx index bfcffc99..f31afac4 100644 --- a/src/components/frontend/dashboard/ActiveCampaigns.tsx +++ b/src/components/frontend/dashboard/ActiveCampaigns.tsx @@ -1,6 +1,6 @@ import Link from "next/link"; -import { Item, ItemContent, ItemHeader, ItemTitle } from "@/components/ui/item"; import { ChevronRightIcon, FlagIcon } from "lucide-react"; +import { TacticalFrame } from "./tactical"; interface CampaignEntry { id: number; @@ -14,73 +14,67 @@ interface ActiveCampaignsProps { } const statusColors: Record = { - inProgress: "bg-blue-500/20 text-blue-400", - concept: "bg-muted text-muted-foreground", - onHold: "bg-amber-500/20 text-amber-400", + inProgress: "bg-blue-500/15 text-blue-400 border-blue-500/30", + concept: "bg-muted text-muted-foreground border-border", + onHold: "bg-amber-500/15 text-amber-400 border-amber-500/30", }; -export function ActiveCampaigns({ campaigns }: ActiveCampaignsProps) { - if (campaigns.length === 0) { - return ( - - -
- - Active Campaigns -
-
- -

No active campaigns.

-
-
- ); - } +const statusLabel = (status: string): string => + status === "inProgress" ? "Active" : status === "onHold" ? "On Hold" : status; +export function ActiveCampaigns({ campaigns }: ActiveCampaignsProps) { return ( - - -
- - Active Campaigns + +
+
+ +

+ Active Campaigns +

- - View all - - - -
- {campaigns.map((campaign) => ( - - -
-
- - {campaign.name} - - - {campaign.status === "inProgress" - ? "Active" - : campaign.status === "onHold" - ? "On Hold" - : campaign.status} - + {campaigns.length > 0 && ( + + View all + + )} +
+ +
+ {campaigns.length === 0 ? ( +

No active campaigns.

+ ) : ( +
+ {campaigns.map((campaign) => ( + + +
+
+ + {campaign.name} + + + {statusLabel(campaign.status)} + +
+ {campaign.summary}
- {campaign.summary} -
- - - ))} -
- - + + + ))} +
+ )} +
+ ); } diff --git a/src/components/frontend/dashboard/MyTickets.tsx b/src/components/frontend/dashboard/MyTickets.tsx index 2465d583..a0a7e62b 100644 --- a/src/components/frontend/dashboard/MyTickets.tsx +++ b/src/components/frontend/dashboard/MyTickets.tsx @@ -1,12 +1,8 @@ import Link from "next/link"; import type { Ticket } from "@/payload-types"; -import { Item, ItemContent, ItemHeader, ItemTitle } from "@/components/ui/item"; import { ChevronRightIcon, LifeBuoyIcon } from "lucide-react"; -import { - CLOSING_STATUSES, - STATUS_STYLES, - statusLabel, -} from "@/lib/tickets/ticketMeta"; +import { STATUS_STYLES, statusLabel } from "@/lib/tickets/ticketMeta"; +import { TacticalFrame } from "./tactical"; interface MyTicketsProps { readonly tickets: Ticket[]; @@ -28,23 +24,26 @@ function timeAgo(dateStr: string): string { export function MyTickets({ tickets, openCount }: MyTicketsProps) { return ( - - -
- - My Tickets + +
+
+ +

My Tickets

{openCount > 0 && ( - {openCount} open + {openCount} open )}
- - View all - - - + {tickets.length > 0 && ( + + View all + + )} +
+ +
{tickets.length === 0 ? (

No tickets yet.

) : ( @@ -53,10 +52,10 @@ export function MyTickets({ tickets, openCount }: MyTicketsProps) { {statusLabel(ticket.status)} @@ -73,7 +72,7 @@ export function MyTickets({ tickets, openCount }: MyTicketsProps) { ))}
)} - - +
+ ); } diff --git a/src/components/frontend/dashboard/OpenNegotiations.tsx b/src/components/frontend/dashboard/OpenNegotiations.tsx index e6488b7d..488c7232 100644 --- a/src/components/frontend/dashboard/OpenNegotiations.tsx +++ b/src/components/frontend/dashboard/OpenNegotiations.tsx @@ -1,9 +1,9 @@ import Link from "next/link"; import type { MarketListing, MarketNegotiation } from "@/payload-types"; -import { Item, ItemContent, ItemHeader, ItemTitle } from "@/components/ui/item"; import { ChevronRightIcon, HandshakeIcon } from "lucide-react"; import type { CurrencyConfig } from "@/lib/banking/format"; import { CurrencyAmount } from "@/components/frontend/banking/CurrencyAmount"; +import { TacticalFrame } from "./tactical"; interface OpenNegotiationsProps { readonly negotiations: MarketNegotiation[]; @@ -40,21 +40,24 @@ export function OpenNegotiations({ const fmt = (n: number) => ; return ( - - -
- - Negotiations - {negotiations.length} open + +
+
+ +

Negotiations

+ + {negotiations.length} open +
Market - - +
+ +
{negotiations.map((negotiation) => { const listing = listingOf(negotiation); @@ -68,7 +71,7 @@ export function OpenNegotiations({
@@ -90,7 +93,7 @@ export function OpenNegotiations({ ); })}
- - +
+ ); } diff --git a/src/components/frontend/dashboard/RecentEvents.tsx b/src/components/frontend/dashboard/RecentEvents.tsx index 87497931..e0c4d1de 100644 --- a/src/components/frontend/dashboard/RecentEvents.tsx +++ b/src/components/frontend/dashboard/RecentEvents.tsx @@ -1,7 +1,7 @@ import type { GameStructure, User } from "@/payload-types"; -import { Item, ItemContent, ItemHeader, ItemTitle } from "@/components/ui/item"; import { BookOpenTextIcon, LockIcon, ScrollTextIcon } from "lucide-react"; import { formatType } from "@/utils/event-log/formatType"; +import { TacticalFrame } from "./tactical"; interface EventEntry { id: number; @@ -33,75 +33,64 @@ function timeAgo(dateStr: string): string { } export function RecentEvents({ events, currentUserId }: RecentEventsProps) { - if (events.length === 0) { - return ( - - -
- - Recent Events -
-
- -

No recent events recorded.

-
-
- ); - } - return ( - - -
- - Recent Events + +
+
+ +

Recent Events

- - -
- {events.map((event, index) => { - const actor = - typeof event.actor === "object" && event.actor !== null - ? (event.actor as User) - : null; - const actorId = actor?.id ?? (typeof event.actor === "number" ? event.actor : null); - const isYou = actorId != null && actorId === currentUserId; - const actorName = actor?.displayName ?? actor?.username ?? null; - const actorLabel = isYou ? "You" : actorName; - const isNarrative = event.system === false; +
- return ( -
-
- {isNarrative && ( - - )} -
-
- {timeAgo(event.timestamp)} - {actorLabel && ( - - {actorLabel} - - )} - {formatType(event.type)} - {event.visibility === "restricted" && ( - - )} +
+ {events.length === 0 ? ( +

No recent events recorded.

+ ) : ( +
+ {events.map((event, index) => { + const actor = + typeof event.actor === "object" && event.actor !== null + ? (event.actor as User) + : null; + const actorId = actor?.id ?? (typeof event.actor === "number" ? event.actor : null); + const isYou = actorId != null && actorId === currentUserId; + const actorName = actor?.displayName ?? actor?.username ?? null; + const actorLabel = isYou ? "You" : actorName; + const isNarrative = event.system === false; + + return ( +
+
+ {isNarrative && ( + + )} +
+
+ {timeAgo(event.timestamp)} + {actorLabel && ( + + {actorLabel} + + )} + {formatType(event.type)} + {event.visibility === "restricted" && ( + + )} +
+ + {event.message} +
- - {event.message} -
+ {index < events.length - 1 &&
}
- {index < events.length - 1 &&
} -
- ); - })} -
- - + ); + })} +
+ )} +
+ ); } diff --git a/src/components/frontend/dashboard/RecentNotifications.tsx b/src/components/frontend/dashboard/RecentNotifications.tsx index e17d5d4b..94eec41d 100644 --- a/src/components/frontend/dashboard/RecentNotifications.tsx +++ b/src/components/frontend/dashboard/RecentNotifications.tsx @@ -1,8 +1,8 @@ import Link from "next/link"; import type { UserNotification } from "@/payload-types"; -import { Item, ItemContent, ItemHeader, ItemTitle } from "@/components/ui/item"; import { BellIcon } from "lucide-react"; import { MarkNotificationReadButton } from "@/components/frontend/dashboard/MarkNotificationReadButton"; +import { TacticalFrame } from "./tactical"; interface RecentNotificationsProps { readonly notifications: UserNotification[]; @@ -31,30 +31,31 @@ export function RecentNotifications({ if (notifications.length === 0) return null; return ( - - -
- - Notifications + +
+
+ +

Notifications

{unreadCount > 0 && ( - {unreadCount} unread + {unreadCount} unread )}
Inbox - - +
+ +
{notifications.map((notification) => { const unread = !notification.read; return (
- - +
+ ); } diff --git a/src/components/frontend/dashboard/UpcomingMissions.tsx b/src/components/frontend/dashboard/UpcomingMissions.tsx index 34ea012a..f4a34f0e 100644 --- a/src/components/frontend/dashboard/UpcomingMissions.tsx +++ b/src/components/frontend/dashboard/UpcomingMissions.tsx @@ -1,53 +1,46 @@ import Link from "next/link"; -import { Item, ItemContent, ItemHeader, ItemTitle } from "@/components/ui/item"; import { MissionCard, type MissionCardProps, } from "@/components/frontend/intelligence/MissionCard"; import { CrosshairIcon } from "lucide-react"; +import { TacticalFrame } from "./tactical"; interface UpcomingMissionsProps { readonly missions: MissionCardProps["mission"][]; } export function UpcomingMissions({ missions }: UpcomingMissionsProps) { - if (missions.length === 0) { - return ( - - -
- - Upcoming Missions -
-
- -

No missions scheduled.

-
-
- ); - } - return ( - - -
- - Upcoming Missions + +
+
+ +

+ Upcoming Missions +

- - View all - - - -
- {missions.map((mission) => ( - - ))} -
-
- + {missions.length > 0 && ( + + View all + + )} +
+ +
+ {missions.length === 0 ? ( +

No missions scheduled.

+ ) : ( +
+ {missions.map((mission) => ( + + ))} +
+ )} +
+
); } diff --git a/src/components/frontend/dashboard/WalletWidget.tsx b/src/components/frontend/dashboard/WalletWidget.tsx index 0f9e5890..51a555e0 100644 --- a/src/components/frontend/dashboard/WalletWidget.tsx +++ b/src/components/frontend/dashboard/WalletWidget.tsx @@ -1,10 +1,10 @@ import Link from "next/link"; import type { BankAccount } from "@/payload-types"; -import { Item, ItemContent, ItemHeader, ItemTitle } from "@/components/ui/item"; import { WalletIcon } from "lucide-react"; import type { CurrencyConfig } from "@/lib/banking/format"; import { CurrencyAmount } from "@/components/frontend/banking/CurrencyAmount"; import { MyWalletCard } from "@/components/frontend/banking/MyWalletCard"; +import { ReadoutFooter, TacticalFrame, refCodeFrom } from "./tactical"; interface WalletWidgetProps { readonly account: BankAccount | null; @@ -12,25 +12,36 @@ interface WalletWidgetProps { } export function WalletWidget({ account, currencyConfig }: WalletWidgetProps) { + // No account yet: the call-to-action card owns its own conventional styling. if (!account) { return ; } + const footerCells = [ + { label: "Acct", value: `#${account.id}` }, + { label: "Status", value: account.status ?? "open" }, + ]; + return ( - - -
- - Wallet + } + > +
+
+ +

Wallet

Banking - - +
+ +
- - +
+
); }