feat(dashboard): apply the tactical dossier style to the remaining widgets
Wallet, Negotiations, My Tickets, Notifications, Upcoming Missions, Active Campaigns and Recent Events were still conventional shadcn Item cards while Service Summary, Mission Briefing and Situation Report already used the dossier primitives. Wrap them in the shared TacticalFrame so the whole dashboard reads as one board: - classification strip naming the domain (Logistics // Banking, Helpdesk // Tickets, and so on), with a REF code on the wallet - squared corners, corner brackets and the faint grid texture - an inner header row of icon + uppercase title + action link, matching the Service Summary widget - squared (rounded-sm, bordered) status pills for tickets and campaigns - a ReadoutFooter on the wallet (account id + status) via the shared ReadoutFooter primitive Empty and self-hiding states are preserved, and the wallet's no-account path still returns the conventional MyWalletCard CTA. Also drops a dead CLOSING_STATUSES import from MyTickets.
This commit is contained in:
parent
2a264a4530
commit
e1cfdd3329
7 changed files with 216 additions and 226 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { Item, ItemContent, ItemHeader, ItemTitle } from "@/components/ui/item";
|
|
||||||
import { ChevronRightIcon, FlagIcon } from "lucide-react";
|
import { ChevronRightIcon, FlagIcon } from "lucide-react";
|
||||||
|
import { TacticalFrame } from "./tactical";
|
||||||
|
|
||||||
interface CampaignEntry {
|
interface CampaignEntry {
|
||||||
id: number;
|
id: number;
|
||||||
|
|
@ -14,73 +14,67 @@ interface ActiveCampaignsProps {
|
||||||
}
|
}
|
||||||
|
|
||||||
const statusColors: Record<string, string> = {
|
const statusColors: Record<string, string> = {
|
||||||
inProgress: "bg-blue-500/20 text-blue-400",
|
inProgress: "bg-blue-500/15 text-blue-400 border-blue-500/30",
|
||||||
concept: "bg-muted text-muted-foreground",
|
concept: "bg-muted text-muted-foreground border-border",
|
||||||
onHold: "bg-amber-500/20 text-amber-400",
|
onHold: "bg-amber-500/15 text-amber-400 border-amber-500/30",
|
||||||
};
|
};
|
||||||
|
|
||||||
export function ActiveCampaigns({ campaigns }: ActiveCampaignsProps) {
|
const statusLabel = (status: string): string =>
|
||||||
if (campaigns.length === 0) {
|
status === "inProgress" ? "Active" : status === "onHold" ? "On Hold" : status;
|
||||||
return (
|
|
||||||
<Item variant="outline">
|
|
||||||
<ItemHeader>
|
|
||||||
<div className="flex items-center gap-2">
|
|
||||||
<FlagIcon className="size-4 text-muted-foreground" />
|
|
||||||
<ItemTitle>Active Campaigns</ItemTitle>
|
|
||||||
</div>
|
|
||||||
</ItemHeader>
|
|
||||||
<ItemContent>
|
|
||||||
<p className="text-sm text-muted-foreground italic">No active campaigns.</p>
|
|
||||||
</ItemContent>
|
|
||||||
</Item>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
export function ActiveCampaigns({ campaigns }: ActiveCampaignsProps) {
|
||||||
return (
|
return (
|
||||||
<Item variant="outline">
|
<TacticalFrame classification="Intelligence // Campaigns">
|
||||||
<ItemHeader>
|
<div className="flex items-center justify-between gap-2 px-4 pt-3">
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex min-w-0 items-center gap-2">
|
||||||
<FlagIcon className="size-4 text-muted-foreground" />
|
<FlagIcon className="size-4 shrink-0 text-muted-foreground" />
|
||||||
<ItemTitle>Active Campaigns</ItemTitle>
|
<h3 className="truncate text-sm font-semibold uppercase tracking-wide">
|
||||||
|
Active Campaigns
|
||||||
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
<Link
|
{campaigns.length > 0 && (
|
||||||
href="/intelligence/campaigns"
|
<Link
|
||||||
className="py-1 text-xs text-muted-foreground hover:text-primary transition-colors"
|
href="/intelligence/campaigns"
|
||||||
>
|
className="shrink-0 py-1 text-xs text-muted-foreground transition-colors hover:text-primary"
|
||||||
View all
|
>
|
||||||
</Link>
|
View all
|
||||||
</ItemHeader>
|
</Link>
|
||||||
<ItemContent>
|
)}
|
||||||
<div className="flex flex-col gap-2">
|
</div>
|
||||||
{campaigns.map((campaign) => (
|
|
||||||
<Link
|
<div className="p-4 pt-3">
|
||||||
key={campaign.id}
|
{campaigns.length === 0 ? (
|
||||||
href={`/intelligence/campaigns/${campaign.id}`}
|
<p className="text-sm italic text-muted-foreground">No active campaigns.</p>
|
||||||
className="flex items-center gap-3 p-2 rounded-md hover:bg-muted/50 transition-colors group"
|
) : (
|
||||||
>
|
<div className="flex flex-col gap-1">
|
||||||
<FlagIcon className="size-4 text-muted-foreground shrink-0" />
|
{campaigns.map((campaign) => (
|
||||||
<div className="flex flex-col gap-0.5 min-w-0 flex-1">
|
<Link
|
||||||
<div className="flex items-center gap-2">
|
key={campaign.id}
|
||||||
<span className="text-sm font-medium truncate group-hover:text-primary transition-colors">
|
href={`/intelligence/campaigns/${campaign.id}`}
|
||||||
{campaign.name}
|
className="group flex items-center gap-3 rounded-sm p-2 transition-colors hover:bg-muted/50"
|
||||||
</span>
|
>
|
||||||
<span
|
<FlagIcon className="size-4 shrink-0 text-muted-foreground" />
|
||||||
className={`text-[10px] font-semibold uppercase tracking-wider px-1.5 py-0.5 rounded shrink-0 ${statusColors[campaign.status] ?? "bg-muted text-muted-foreground"}`}
|
<div className="flex min-w-0 flex-1 flex-col gap-0.5">
|
||||||
>
|
<div className="flex items-center gap-2">
|
||||||
{campaign.status === "inProgress"
|
<span className="truncate text-sm font-medium transition-colors group-hover:text-primary">
|
||||||
? "Active"
|
{campaign.name}
|
||||||
: campaign.status === "onHold"
|
</span>
|
||||||
? "On Hold"
|
<span
|
||||||
: campaign.status}
|
className={`shrink-0 rounded-sm border px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wider ${
|
||||||
</span>
|
statusColors[campaign.status] ?? "bg-muted text-muted-foreground border-border"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
{statusLabel(campaign.status)}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<span className="truncate text-xs text-muted-foreground">{campaign.summary}</span>
|
||||||
</div>
|
</div>
|
||||||
<span className="text-xs text-muted-foreground truncate">{campaign.summary}</span>
|
<ChevronRightIcon className="size-3 shrink-0 text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100" />
|
||||||
</div>
|
</Link>
|
||||||
<ChevronRightIcon className="size-3 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0" />
|
))}
|
||||||
</Link>
|
</div>
|
||||||
))}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</ItemContent>
|
</TacticalFrame>
|
||||||
</Item>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,8 @@
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import type { Ticket } from "@/payload-types";
|
import type { Ticket } from "@/payload-types";
|
||||||
import { Item, ItemContent, ItemHeader, ItemTitle } from "@/components/ui/item";
|
|
||||||
import { ChevronRightIcon, LifeBuoyIcon } from "lucide-react";
|
import { ChevronRightIcon, LifeBuoyIcon } from "lucide-react";
|
||||||
import {
|
import { STATUS_STYLES, statusLabel } from "@/lib/tickets/ticketMeta";
|
||||||
CLOSING_STATUSES,
|
import { TacticalFrame } from "./tactical";
|
||||||
STATUS_STYLES,
|
|
||||||
statusLabel,
|
|
||||||
} from "@/lib/tickets/ticketMeta";
|
|
||||||
|
|
||||||
interface MyTicketsProps {
|
interface MyTicketsProps {
|
||||||
readonly tickets: Ticket[];
|
readonly tickets: Ticket[];
|
||||||
|
|
@ -28,23 +24,26 @@ function timeAgo(dateStr: string): string {
|
||||||
|
|
||||||
export function MyTickets({ tickets, openCount }: MyTicketsProps) {
|
export function MyTickets({ tickets, openCount }: MyTicketsProps) {
|
||||||
return (
|
return (
|
||||||
<Item variant="outline">
|
<TacticalFrame classification="Helpdesk // Tickets">
|
||||||
<ItemHeader>
|
<div className="flex items-center justify-between gap-2 px-4 pt-3">
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex min-w-0 items-center gap-2">
|
||||||
<LifeBuoyIcon className="size-4 text-muted-foreground" />
|
<LifeBuoyIcon className="size-4 shrink-0 text-muted-foreground" />
|
||||||
<ItemTitle>My Tickets</ItemTitle>
|
<h3 className="truncate text-sm font-semibold uppercase tracking-wide">My Tickets</h3>
|
||||||
{openCount > 0 && (
|
{openCount > 0 && (
|
||||||
<span className="text-xs text-muted-foreground">{openCount} open</span>
|
<span className="shrink-0 text-xs text-muted-foreground">{openCount} open</span>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<Link
|
{tickets.length > 0 && (
|
||||||
href="/helpdesk"
|
<Link
|
||||||
className="py-1 text-xs text-muted-foreground transition-colors hover:text-primary"
|
href="/helpdesk"
|
||||||
>
|
className="shrink-0 py-1 text-xs text-muted-foreground transition-colors hover:text-primary"
|
||||||
View all
|
>
|
||||||
</Link>
|
View all
|
||||||
</ItemHeader>
|
</Link>
|
||||||
<ItemContent>
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="p-4 pt-3">
|
||||||
{tickets.length === 0 ? (
|
{tickets.length === 0 ? (
|
||||||
<p className="text-sm italic text-muted-foreground">No tickets yet.</p>
|
<p className="text-sm italic text-muted-foreground">No tickets yet.</p>
|
||||||
) : (
|
) : (
|
||||||
|
|
@ -53,10 +52,10 @@ export function MyTickets({ tickets, openCount }: MyTicketsProps) {
|
||||||
<Link
|
<Link
|
||||||
key={ticket.id}
|
key={ticket.id}
|
||||||
href={`/helpdesk/${ticket.id}`}
|
href={`/helpdesk/${ticket.id}`}
|
||||||
className="group flex items-center gap-3 rounded-md p-2 transition-colors hover:bg-muted/50"
|
className="group flex items-center gap-3 rounded-sm p-2 transition-colors hover:bg-muted/50"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
className={`shrink-0 rounded border px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wider ${STATUS_STYLES[ticket.status]}`}
|
className={`shrink-0 rounded-sm border px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wider ${STATUS_STYLES[ticket.status]}`}
|
||||||
>
|
>
|
||||||
{statusLabel(ticket.status)}
|
{statusLabel(ticket.status)}
|
||||||
</span>
|
</span>
|
||||||
|
|
@ -73,7 +72,7 @@ export function MyTickets({ tickets, openCount }: MyTicketsProps) {
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</ItemContent>
|
</div>
|
||||||
</Item>
|
</TacticalFrame>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import type { MarketListing, MarketNegotiation } from "@/payload-types";
|
import type { MarketListing, MarketNegotiation } from "@/payload-types";
|
||||||
import { Item, ItemContent, ItemHeader, ItemTitle } from "@/components/ui/item";
|
|
||||||
import { ChevronRightIcon, HandshakeIcon } from "lucide-react";
|
import { ChevronRightIcon, HandshakeIcon } from "lucide-react";
|
||||||
import type { CurrencyConfig } from "@/lib/banking/format";
|
import type { CurrencyConfig } from "@/lib/banking/format";
|
||||||
import { CurrencyAmount } from "@/components/frontend/banking/CurrencyAmount";
|
import { CurrencyAmount } from "@/components/frontend/banking/CurrencyAmount";
|
||||||
|
import { TacticalFrame } from "./tactical";
|
||||||
|
|
||||||
interface OpenNegotiationsProps {
|
interface OpenNegotiationsProps {
|
||||||
readonly negotiations: MarketNegotiation[];
|
readonly negotiations: MarketNegotiation[];
|
||||||
|
|
@ -40,21 +40,24 @@ export function OpenNegotiations({
|
||||||
const fmt = (n: number) => <CurrencyAmount value={n} currency={currencyConfig} />;
|
const fmt = (n: number) => <CurrencyAmount value={n} currency={currencyConfig} />;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Item variant="outline">
|
<TacticalFrame classification="Logistics // Market">
|
||||||
<ItemHeader>
|
<div className="flex items-center justify-between gap-2 px-4 pt-3">
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex min-w-0 items-center gap-2">
|
||||||
<HandshakeIcon className="size-4 text-muted-foreground" />
|
<HandshakeIcon className="size-4 shrink-0 text-muted-foreground" />
|
||||||
<ItemTitle>Negotiations</ItemTitle>
|
<h3 className="truncate text-sm font-semibold uppercase tracking-wide">Negotiations</h3>
|
||||||
<span className="text-xs text-muted-foreground">{negotiations.length} open</span>
|
<span className="shrink-0 text-xs text-muted-foreground">
|
||||||
|
{negotiations.length} open
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<Link
|
<Link
|
||||||
href="/logistics/market"
|
href="/logistics/market"
|
||||||
className="py-1 text-xs text-muted-foreground transition-colors hover:text-primary"
|
className="shrink-0 py-1 text-xs text-muted-foreground transition-colors hover:text-primary"
|
||||||
>
|
>
|
||||||
Market
|
Market
|
||||||
</Link>
|
</Link>
|
||||||
</ItemHeader>
|
</div>
|
||||||
<ItemContent>
|
|
||||||
|
<div className="p-4 pt-3">
|
||||||
<div className="flex flex-col gap-1">
|
<div className="flex flex-col gap-1">
|
||||||
{negotiations.map((negotiation) => {
|
{negotiations.map((negotiation) => {
|
||||||
const listing = listingOf(negotiation);
|
const listing = listingOf(negotiation);
|
||||||
|
|
@ -68,7 +71,7 @@ export function OpenNegotiations({
|
||||||
<Link
|
<Link
|
||||||
key={negotiation.id}
|
key={negotiation.id}
|
||||||
href="/logistics/market"
|
href="/logistics/market"
|
||||||
className="group flex items-center gap-3 rounded-md p-2 transition-colors hover:bg-muted/50"
|
className="group flex items-center gap-3 rounded-sm p-2 transition-colors hover:bg-muted/50"
|
||||||
>
|
>
|
||||||
<HandshakeIcon className="size-4 shrink-0 text-muted-foreground" />
|
<HandshakeIcon className="size-4 shrink-0 text-muted-foreground" />
|
||||||
<div className="flex min-w-0 flex-1 flex-col gap-0.5">
|
<div className="flex min-w-0 flex-1 flex-col gap-0.5">
|
||||||
|
|
@ -90,7 +93,7 @@ export function OpenNegotiations({
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
</ItemContent>
|
</div>
|
||||||
</Item>
|
</TacticalFrame>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import type { GameStructure, User } from "@/payload-types";
|
import type { GameStructure, User } from "@/payload-types";
|
||||||
import { Item, ItemContent, ItemHeader, ItemTitle } from "@/components/ui/item";
|
|
||||||
import { BookOpenTextIcon, LockIcon, ScrollTextIcon } from "lucide-react";
|
import { BookOpenTextIcon, LockIcon, ScrollTextIcon } from "lucide-react";
|
||||||
import { formatType } from "@/utils/event-log/formatType";
|
import { formatType } from "@/utils/event-log/formatType";
|
||||||
|
import { TacticalFrame } from "./tactical";
|
||||||
|
|
||||||
interface EventEntry {
|
interface EventEntry {
|
||||||
id: number;
|
id: number;
|
||||||
|
|
@ -33,75 +33,64 @@ function timeAgo(dateStr: string): string {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function RecentEvents({ events, currentUserId }: RecentEventsProps) {
|
export function RecentEvents({ events, currentUserId }: RecentEventsProps) {
|
||||||
if (events.length === 0) {
|
|
||||||
return (
|
|
||||||
<Item variant="outline">
|
|
||||||
<ItemHeader>
|
|
||||||
<div className="flex items-center gap-2">
|
|
||||||
<ScrollTextIcon className="size-4 text-muted-foreground" />
|
|
||||||
<ItemTitle>Recent Events</ItemTitle>
|
|
||||||
</div>
|
|
||||||
</ItemHeader>
|
|
||||||
<ItemContent>
|
|
||||||
<p className="text-sm text-muted-foreground italic">No recent events recorded.</p>
|
|
||||||
</ItemContent>
|
|
||||||
</Item>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Item variant="outline">
|
<TacticalFrame classification="Event Log // Recent">
|
||||||
<ItemHeader>
|
<div className="flex items-center justify-between gap-2 px-4 pt-3">
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex min-w-0 items-center gap-2">
|
||||||
<ScrollTextIcon className="size-4 text-muted-foreground" />
|
<ScrollTextIcon className="size-4 shrink-0 text-muted-foreground" />
|
||||||
<ItemTitle>Recent Events</ItemTitle>
|
<h3 className="truncate text-sm font-semibold uppercase tracking-wide">Recent Events</h3>
|
||||||
</div>
|
</div>
|
||||||
</ItemHeader>
|
</div>
|
||||||
<ItemContent>
|
|
||||||
<div className="flex flex-col">
|
|
||||||
{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 (
|
<div className="p-4 pt-3">
|
||||||
<div key={event.id}>
|
{events.length === 0 ? (
|
||||||
<div
|
<p className="text-sm italic text-muted-foreground">No recent events recorded.</p>
|
||||||
className={`flex items-start gap-3 py-2 text-sm ${isNarrative ? "pl-3 border-l-2 border-amber-500/40" : ""}`}
|
) : (
|
||||||
>
|
<div className="flex flex-col">
|
||||||
{isNarrative && (
|
{events.map((event, index) => {
|
||||||
<BookOpenTextIcon className="size-4 text-amber-400 shrink-0 mt-0.5" />
|
const actor =
|
||||||
)}
|
typeof event.actor === "object" && event.actor !== null
|
||||||
<div className="flex-1 min-w-0 flex flex-col gap-0.5">
|
? (event.actor as User)
|
||||||
<div className="flex items-center gap-2 text-xs text-muted-foreground">
|
: null;
|
||||||
<span className="tabular-nums shrink-0">{timeAgo(event.timestamp)}</span>
|
const actorId = actor?.id ?? (typeof event.actor === "number" ? event.actor : null);
|
||||||
{actorLabel && (
|
const isYou = actorId != null && actorId === currentUserId;
|
||||||
<span className={`font-medium ${isYou ? "text-foreground" : ""}`}>
|
const actorName = actor?.displayName ?? actor?.username ?? null;
|
||||||
{actorLabel}
|
const actorLabel = isYou ? "You" : actorName;
|
||||||
</span>
|
const isNarrative = event.system === false;
|
||||||
)}
|
|
||||||
<span className="capitalize">{formatType(event.type)}</span>
|
return (
|
||||||
{event.visibility === "restricted" && (
|
<div key={event.id}>
|
||||||
<LockIcon className="size-3 text-amber-400 shrink-0" />
|
<div
|
||||||
)}
|
className={`flex items-start gap-3 py-2 text-sm ${isNarrative ? "border-l-2 border-amber-500/40 pl-3" : ""}`}
|
||||||
|
>
|
||||||
|
{isNarrative && (
|
||||||
|
<BookOpenTextIcon className="mt-0.5 size-4 shrink-0 text-amber-400" />
|
||||||
|
)}
|
||||||
|
<div className="flex min-w-0 flex-1 flex-col gap-0.5">
|
||||||
|
<div className="flex items-center gap-2 text-xs text-muted-foreground">
|
||||||
|
<span className="shrink-0 tabular-nums">{timeAgo(event.timestamp)}</span>
|
||||||
|
{actorLabel && (
|
||||||
|
<span className={`font-medium ${isYou ? "text-foreground" : ""}`}>
|
||||||
|
{actorLabel}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
<span className="capitalize">{formatType(event.type)}</span>
|
||||||
|
{event.visibility === "restricted" && (
|
||||||
|
<LockIcon className="size-3 shrink-0 text-amber-400" />
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<span className={`min-w-0 ${isNarrative ? "text-amber-100/90" : ""}`}>
|
||||||
|
{event.message}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<span className={`min-w-0 ${isNarrative ? "text-amber-100/90" : ""}`}>
|
|
||||||
{event.message}
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
|
{index < events.length - 1 && <div className="border-t border-border" />}
|
||||||
</div>
|
</div>
|
||||||
{index < events.length - 1 && <div className="border-t border-border" />}
|
);
|
||||||
</div>
|
})}
|
||||||
);
|
</div>
|
||||||
})}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</ItemContent>
|
</TacticalFrame>
|
||||||
</Item>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import type { UserNotification } from "@/payload-types";
|
import type { UserNotification } from "@/payload-types";
|
||||||
import { Item, ItemContent, ItemHeader, ItemTitle } from "@/components/ui/item";
|
|
||||||
import { BellIcon } from "lucide-react";
|
import { BellIcon } from "lucide-react";
|
||||||
import { MarkNotificationReadButton } from "@/components/frontend/dashboard/MarkNotificationReadButton";
|
import { MarkNotificationReadButton } from "@/components/frontend/dashboard/MarkNotificationReadButton";
|
||||||
|
import { TacticalFrame } from "./tactical";
|
||||||
|
|
||||||
interface RecentNotificationsProps {
|
interface RecentNotificationsProps {
|
||||||
readonly notifications: UserNotification[];
|
readonly notifications: UserNotification[];
|
||||||
|
|
@ -31,30 +31,31 @@ export function RecentNotifications({
|
||||||
if (notifications.length === 0) return null;
|
if (notifications.length === 0) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Item variant="outline">
|
<TacticalFrame classification="Comms // Notifications">
|
||||||
<ItemHeader>
|
<div className="flex items-center justify-between gap-2 px-4 pt-3">
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex min-w-0 items-center gap-2">
|
||||||
<BellIcon className="size-4 text-muted-foreground" />
|
<BellIcon className="size-4 shrink-0 text-muted-foreground" />
|
||||||
<ItemTitle>Notifications</ItemTitle>
|
<h3 className="truncate text-sm font-semibold uppercase tracking-wide">Notifications</h3>
|
||||||
{unreadCount > 0 && (
|
{unreadCount > 0 && (
|
||||||
<span className="text-xs text-muted-foreground">{unreadCount} unread</span>
|
<span className="shrink-0 text-xs text-muted-foreground">{unreadCount} unread</span>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<Link
|
<Link
|
||||||
href="/notifications"
|
href="/notifications"
|
||||||
className="py-1 text-xs text-muted-foreground transition-colors hover:text-primary"
|
className="shrink-0 py-1 text-xs text-muted-foreground transition-colors hover:text-primary"
|
||||||
>
|
>
|
||||||
Inbox
|
Inbox
|
||||||
</Link>
|
</Link>
|
||||||
</ItemHeader>
|
</div>
|
||||||
<ItemContent>
|
|
||||||
|
<div className="p-4 pt-3">
|
||||||
<div className="flex flex-col gap-1">
|
<div className="flex flex-col gap-1">
|
||||||
{notifications.map((notification) => {
|
{notifications.map((notification) => {
|
||||||
const unread = !notification.read;
|
const unread = !notification.read;
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
key={notification.id}
|
key={notification.id}
|
||||||
className="group flex items-start gap-1 rounded-md p-2 transition-colors hover:bg-muted/50"
|
className="group flex items-start gap-1 rounded-sm p-2 transition-colors hover:bg-muted/50"
|
||||||
>
|
>
|
||||||
<Link
|
<Link
|
||||||
href={notification.link ?? "/notifications"}
|
href={notification.link ?? "/notifications"}
|
||||||
|
|
@ -93,7 +94,7 @@ export function RecentNotifications({
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
</ItemContent>
|
</div>
|
||||||
</Item>
|
</TacticalFrame>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,53 +1,46 @@
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { Item, ItemContent, ItemHeader, ItemTitle } from "@/components/ui/item";
|
|
||||||
import {
|
import {
|
||||||
MissionCard,
|
MissionCard,
|
||||||
type MissionCardProps,
|
type MissionCardProps,
|
||||||
} from "@/components/frontend/intelligence/MissionCard";
|
} from "@/components/frontend/intelligence/MissionCard";
|
||||||
import { CrosshairIcon } from "lucide-react";
|
import { CrosshairIcon } from "lucide-react";
|
||||||
|
import { TacticalFrame } from "./tactical";
|
||||||
|
|
||||||
interface UpcomingMissionsProps {
|
interface UpcomingMissionsProps {
|
||||||
readonly missions: MissionCardProps["mission"][];
|
readonly missions: MissionCardProps["mission"][];
|
||||||
}
|
}
|
||||||
|
|
||||||
export function UpcomingMissions({ missions }: UpcomingMissionsProps) {
|
export function UpcomingMissions({ missions }: UpcomingMissionsProps) {
|
||||||
if (missions.length === 0) {
|
|
||||||
return (
|
|
||||||
<Item variant="outline">
|
|
||||||
<ItemHeader>
|
|
||||||
<div className="flex items-center gap-2">
|
|
||||||
<CrosshairIcon className="size-4 text-muted-foreground" />
|
|
||||||
<ItemTitle>Upcoming Missions</ItemTitle>
|
|
||||||
</div>
|
|
||||||
</ItemHeader>
|
|
||||||
<ItemContent>
|
|
||||||
<p className="text-sm text-muted-foreground italic">No missions scheduled.</p>
|
|
||||||
</ItemContent>
|
|
||||||
</Item>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Item variant="outline">
|
<TacticalFrame classification="Operations // Upcoming">
|
||||||
<ItemHeader>
|
<div className="flex items-center justify-between gap-2 px-4 pt-3">
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex min-w-0 items-center gap-2">
|
||||||
<CrosshairIcon className="size-4 text-muted-foreground" />
|
<CrosshairIcon className="size-4 shrink-0 text-muted-foreground" />
|
||||||
<ItemTitle>Upcoming Missions</ItemTitle>
|
<h3 className="truncate text-sm font-semibold uppercase tracking-wide">
|
||||||
|
Upcoming Missions
|
||||||
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
<Link
|
{missions.length > 0 && (
|
||||||
href="/intelligence/missions"
|
<Link
|
||||||
className="py-1 text-xs text-muted-foreground transition-colors hover:text-primary"
|
href="/intelligence/missions"
|
||||||
>
|
className="shrink-0 py-1 text-xs text-muted-foreground transition-colors hover:text-primary"
|
||||||
View all
|
>
|
||||||
</Link>
|
View all
|
||||||
</ItemHeader>
|
</Link>
|
||||||
<ItemContent>
|
)}
|
||||||
<div className="flex flex-col gap-2">
|
</div>
|
||||||
{missions.map((mission) => (
|
|
||||||
<MissionCard key={mission.id} mission={mission} showFullDetails={false} />
|
<div className="p-4 pt-3">
|
||||||
))}
|
{missions.length === 0 ? (
|
||||||
</div>
|
<p className="text-sm italic text-muted-foreground">No missions scheduled.</p>
|
||||||
</ItemContent>
|
) : (
|
||||||
</Item>
|
<div className="flex flex-col gap-2">
|
||||||
|
{missions.map((mission) => (
|
||||||
|
<MissionCard key={mission.id} mission={mission} showFullDetails={false} />
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</TacticalFrame>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import type { BankAccount } from "@/payload-types";
|
import type { BankAccount } from "@/payload-types";
|
||||||
import { Item, ItemContent, ItemHeader, ItemTitle } from "@/components/ui/item";
|
|
||||||
import { WalletIcon } from "lucide-react";
|
import { WalletIcon } from "lucide-react";
|
||||||
import type { CurrencyConfig } from "@/lib/banking/format";
|
import type { CurrencyConfig } from "@/lib/banking/format";
|
||||||
import { CurrencyAmount } from "@/components/frontend/banking/CurrencyAmount";
|
import { CurrencyAmount } from "@/components/frontend/banking/CurrencyAmount";
|
||||||
import { MyWalletCard } from "@/components/frontend/banking/MyWalletCard";
|
import { MyWalletCard } from "@/components/frontend/banking/MyWalletCard";
|
||||||
|
import { ReadoutFooter, TacticalFrame, refCodeFrom } from "./tactical";
|
||||||
|
|
||||||
interface WalletWidgetProps {
|
interface WalletWidgetProps {
|
||||||
readonly account: BankAccount | null;
|
readonly account: BankAccount | null;
|
||||||
|
|
@ -12,25 +12,36 @@ interface WalletWidgetProps {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function WalletWidget({ account, currencyConfig }: WalletWidgetProps) {
|
export function WalletWidget({ account, currencyConfig }: WalletWidgetProps) {
|
||||||
|
// No account yet: the call-to-action card owns its own conventional styling.
|
||||||
if (!account) {
|
if (!account) {
|
||||||
return <MyWalletCard />;
|
return <MyWalletCard />;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const footerCells = [
|
||||||
|
{ label: "Acct", value: `#${account.id}` },
|
||||||
|
{ label: "Status", value: account.status ?? "open" },
|
||||||
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Item variant="outline">
|
<TacticalFrame
|
||||||
<ItemHeader>
|
classification="Logistics // Banking"
|
||||||
<div className="flex items-center gap-2">
|
refCode={`REF ${refCodeFrom(account.id)}`}
|
||||||
<WalletIcon className="size-4 text-muted-foreground" />
|
footer={<ReadoutFooter cells={footerCells} />}
|
||||||
<ItemTitle>Wallet</ItemTitle>
|
>
|
||||||
|
<div className="flex items-center justify-between gap-2 px-4 pt-3">
|
||||||
|
<div className="flex min-w-0 items-center gap-2">
|
||||||
|
<WalletIcon className="size-4 shrink-0 text-muted-foreground" />
|
||||||
|
<h3 className="truncate text-sm font-semibold uppercase tracking-wide">Wallet</h3>
|
||||||
</div>
|
</div>
|
||||||
<Link
|
<Link
|
||||||
href="/logistics/banking"
|
href="/logistics/banking"
|
||||||
className="py-1 text-xs text-muted-foreground transition-colors hover:text-primary"
|
className="shrink-0 py-1 text-xs text-muted-foreground transition-colors hover:text-primary"
|
||||||
>
|
>
|
||||||
Banking
|
Banking
|
||||||
</Link>
|
</Link>
|
||||||
</ItemHeader>
|
</div>
|
||||||
<ItemContent>
|
|
||||||
|
<div className="p-4 pt-3">
|
||||||
<Link
|
<Link
|
||||||
href={`/logistics/banking/${account.id}`}
|
href={`/logistics/banking/${account.id}`}
|
||||||
className="group flex items-center justify-between gap-3"
|
className="group flex items-center justify-between gap-3"
|
||||||
|
|
@ -48,7 +59,7 @@ export function WalletWidget({ account, currencyConfig }: WalletWidgetProps) {
|
||||||
<CurrencyAmount value={account.balance ?? 0} currency={currencyConfig} />
|
<CurrencyAmount value={account.balance ?? 0} currency={currencyConfig} />
|
||||||
</span>
|
</span>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemContent>
|
</div>
|
||||||
</Item>
|
</TacticalFrame>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue