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>
|
||||||
|
{campaigns.length > 0 && (
|
||||||
<Link
|
<Link
|
||||||
href="/intelligence/campaigns"
|
href="/intelligence/campaigns"
|
||||||
className="py-1 text-xs text-muted-foreground hover:text-primary transition-colors"
|
className="shrink-0 py-1 text-xs text-muted-foreground transition-colors hover:text-primary"
|
||||||
>
|
>
|
||||||
View all
|
View all
|
||||||
</Link>
|
</Link>
|
||||||
</ItemHeader>
|
)}
|
||||||
<ItemContent>
|
</div>
|
||||||
<div className="flex flex-col gap-2">
|
|
||||||
|
<div className="p-4 pt-3">
|
||||||
|
{campaigns.length === 0 ? (
|
||||||
|
<p className="text-sm italic text-muted-foreground">No active campaigns.</p>
|
||||||
|
) : (
|
||||||
|
<div className="flex flex-col gap-1">
|
||||||
{campaigns.map((campaign) => (
|
{campaigns.map((campaign) => (
|
||||||
<Link
|
<Link
|
||||||
key={campaign.id}
|
key={campaign.id}
|
||||||
href={`/intelligence/campaigns/${campaign.id}`}
|
href={`/intelligence/campaigns/${campaign.id}`}
|
||||||
className="flex items-center gap-3 p-2 rounded-md hover:bg-muted/50 transition-colors group"
|
className="group flex items-center gap-3 rounded-sm p-2 transition-colors hover:bg-muted/50"
|
||||||
>
|
>
|
||||||
<FlagIcon className="size-4 text-muted-foreground shrink-0" />
|
<FlagIcon className="size-4 shrink-0 text-muted-foreground" />
|
||||||
<div className="flex flex-col gap-0.5 min-w-0 flex-1">
|
<div className="flex min-w-0 flex-1 flex-col gap-0.5">
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<span className="text-sm font-medium truncate group-hover:text-primary transition-colors">
|
<span className="truncate text-sm font-medium transition-colors group-hover:text-primary">
|
||||||
{campaign.name}
|
{campaign.name}
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
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"}`}
|
className={`shrink-0 rounded-sm border px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wider ${
|
||||||
|
statusColors[campaign.status] ?? "bg-muted text-muted-foreground border-border"
|
||||||
|
}`}
|
||||||
>
|
>
|
||||||
{campaign.status === "inProgress"
|
{statusLabel(campaign.status)}
|
||||||
? "Active"
|
|
||||||
: campaign.status === "onHold"
|
|
||||||
? "On Hold"
|
|
||||||
: campaign.status}
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<span className="text-xs text-muted-foreground truncate">{campaign.summary}</span>
|
<span className="truncate text-xs text-muted-foreground">{campaign.summary}</span>
|
||||||
</div>
|
</div>
|
||||||
<ChevronRightIcon className="size-3 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0" />
|
<ChevronRightIcon className="size-3 shrink-0 text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100" />
|
||||||
</Link>
|
</Link>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</ItemContent>
|
)}
|
||||||
</Item>
|
</div>
|
||||||
|
</TacticalFrame>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
{tickets.length > 0 && (
|
||||||
<Link
|
<Link
|
||||||
href="/helpdesk"
|
href="/helpdesk"
|
||||||
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"
|
||||||
>
|
>
|
||||||
View all
|
View all
|
||||||
</Link>
|
</Link>
|
||||||
</ItemHeader>
|
)}
|
||||||
<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,31 +33,19 @@ function timeAgo(dateStr: string): string {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function RecentEvents({ events, currentUserId }: RecentEventsProps) {
|
export function RecentEvents({ events, currentUserId }: RecentEventsProps) {
|
||||||
if (events.length === 0) {
|
|
||||||
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>
|
</div>
|
||||||
</ItemHeader>
|
|
||||||
<ItemContent>
|
|
||||||
<p className="text-sm text-muted-foreground italic">No recent events recorded.</p>
|
|
||||||
</ItemContent>
|
|
||||||
</Item>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
<div className="p-4 pt-3">
|
||||||
<Item variant="outline">
|
{events.length === 0 ? (
|
||||||
<ItemHeader>
|
<p className="text-sm italic text-muted-foreground">No recent events recorded.</p>
|
||||||
<div className="flex items-center gap-2">
|
) : (
|
||||||
<ScrollTextIcon className="size-4 text-muted-foreground" />
|
|
||||||
<ItemTitle>Recent Events</ItemTitle>
|
|
||||||
</div>
|
|
||||||
</ItemHeader>
|
|
||||||
<ItemContent>
|
|
||||||
<div className="flex flex-col">
|
<div className="flex flex-col">
|
||||||
{events.map((event, index) => {
|
{events.map((event, index) => {
|
||||||
const actor =
|
const actor =
|
||||||
|
|
@ -73,14 +61,14 @@ export function RecentEvents({ events, currentUserId }: RecentEventsProps) {
|
||||||
return (
|
return (
|
||||||
<div key={event.id}>
|
<div key={event.id}>
|
||||||
<div
|
<div
|
||||||
className={`flex items-start gap-3 py-2 text-sm ${isNarrative ? "pl-3 border-l-2 border-amber-500/40" : ""}`}
|
className={`flex items-start gap-3 py-2 text-sm ${isNarrative ? "border-l-2 border-amber-500/40 pl-3" : ""}`}
|
||||||
>
|
>
|
||||||
{isNarrative && (
|
{isNarrative && (
|
||||||
<BookOpenTextIcon className="size-4 text-amber-400 shrink-0 mt-0.5" />
|
<BookOpenTextIcon className="mt-0.5 size-4 shrink-0 text-amber-400" />
|
||||||
)}
|
)}
|
||||||
<div className="flex-1 min-w-0 flex flex-col gap-0.5">
|
<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">
|
<div className="flex items-center gap-2 text-xs text-muted-foreground">
|
||||||
<span className="tabular-nums shrink-0">{timeAgo(event.timestamp)}</span>
|
<span className="shrink-0 tabular-nums">{timeAgo(event.timestamp)}</span>
|
||||||
{actorLabel && (
|
{actorLabel && (
|
||||||
<span className={`font-medium ${isYou ? "text-foreground" : ""}`}>
|
<span className={`font-medium ${isYou ? "text-foreground" : ""}`}>
|
||||||
{actorLabel}
|
{actorLabel}
|
||||||
|
|
@ -88,7 +76,7 @@ export function RecentEvents({ events, currentUserId }: RecentEventsProps) {
|
||||||
)}
|
)}
|
||||||
<span className="capitalize">{formatType(event.type)}</span>
|
<span className="capitalize">{formatType(event.type)}</span>
|
||||||
{event.visibility === "restricted" && (
|
{event.visibility === "restricted" && (
|
||||||
<LockIcon className="size-3 text-amber-400 shrink-0" />
|
<LockIcon className="size-3 shrink-0 text-amber-400" />
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<span className={`min-w-0 ${isNarrative ? "text-amber-100/90" : ""}`}>
|
<span className={`min-w-0 ${isNarrative ? "text-amber-100/90" : ""}`}>
|
||||||
|
|
@ -101,7 +89,8 @@ export function RecentEvents({ events, currentUserId }: RecentEventsProps) {
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
</ItemContent>
|
)}
|
||||||
</Item>
|
</div>
|
||||||
|
</TacticalFrame>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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 (
|
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">
|
||||||
</div>
|
Upcoming Missions
|
||||||
</ItemHeader>
|
</h3>
|
||||||
<ItemContent>
|
|
||||||
<p className="text-sm text-muted-foreground italic">No missions scheduled.</p>
|
|
||||||
</ItemContent>
|
|
||||||
</Item>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Item variant="outline">
|
|
||||||
<ItemHeader>
|
|
||||||
<div className="flex items-center gap-2">
|
|
||||||
<CrosshairIcon className="size-4 text-muted-foreground" />
|
|
||||||
<ItemTitle>Upcoming Missions</ItemTitle>
|
|
||||||
</div>
|
</div>
|
||||||
|
{missions.length > 0 && (
|
||||||
<Link
|
<Link
|
||||||
href="/intelligence/missions"
|
href="/intelligence/missions"
|
||||||
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"
|
||||||
>
|
>
|
||||||
View all
|
View all
|
||||||
</Link>
|
</Link>
|
||||||
</ItemHeader>
|
)}
|
||||||
<ItemContent>
|
</div>
|
||||||
|
|
||||||
|
<div className="p-4 pt-3">
|
||||||
|
{missions.length === 0 ? (
|
||||||
|
<p className="text-sm italic text-muted-foreground">No missions scheduled.</p>
|
||||||
|
) : (
|
||||||
<div className="flex flex-col gap-2">
|
<div className="flex flex-col gap-2">
|
||||||
{missions.map((mission) => (
|
{missions.map((mission) => (
|
||||||
<MissionCard key={mission.id} mission={mission} showFullDetails={false} />
|
<MissionCard key={mission.id} mission={mission} showFullDetails={false} />
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</ItemContent>
|
)}
|
||||||
</Item>
|
</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