feat(frontend): style mission details sections as dossier cards
Wrap each main-content section of the mission details page in a TacticalFrame card (classification strip, corner brackets, grid texture, readout footer) following the tactical dossier recipe. Add a `grow` prop to TacticalFrame for content-height frames. The hero header is left untouched.
This commit is contained in:
parent
5d4dbab36b
commit
7380131510
2 changed files with 145 additions and 65 deletions
|
|
@ -18,6 +18,7 @@ import {
|
||||||
import { Item, ItemContent, ItemHeader, ItemTitle } from "@/components/ui/item";
|
import { Item, ItemContent, ItemHeader, ItemTitle } from "@/components/ui/item";
|
||||||
import { ClientDate } from "@/components/frontend/ClientDate";
|
import { ClientDate } from "@/components/frontend/ClientDate";
|
||||||
import { MissionBriefingSection } from "@/components/frontend/intelligence/MissionBriefingSection";
|
import { MissionBriefingSection } from "@/components/frontend/intelligence/MissionBriefingSection";
|
||||||
|
import { ReadoutFooter, TacticalFrame, refCodeFrom } from "@/components/frontend/dashboard/tactical";
|
||||||
import { MissionObjectives } from "@/components/frontend/intelligence/MissionObjectives";
|
import { MissionObjectives } from "@/components/frontend/intelligence/MissionObjectives";
|
||||||
import { hasPermission } from "@/utils/access-control/hasPermission";
|
import { hasPermission } from "@/utils/access-control/hasPermission";
|
||||||
import { redactText } from "@/lib/redaction";
|
import { redactText } from "@/lib/redaction";
|
||||||
|
|
@ -509,84 +510,158 @@ export default async function MissionDetailPage({ params }: MissionDetailPagePro
|
||||||
<div className="grid grid-cols-1 xl:grid-cols-3 gap-6">
|
<div className="grid grid-cols-1 xl:grid-cols-3 gap-6">
|
||||||
{/* ── Main Content (2/3) ──────────────────────────── */}
|
{/* ── Main Content (2/3) ──────────────────────────── */}
|
||||||
<div className="xl:col-span-2 flex flex-col gap-6">
|
<div className="xl:col-span-2 flex flex-col gap-6">
|
||||||
<MissionRating
|
<TacticalFrame
|
||||||
missionId={mission.id}
|
classification="RATING // THREAT"
|
||||||
state={ratingState}
|
refCode={`REF ${refCodeFrom(mission.id)}`}
|
||||||
aggregate={ratingAggregate}
|
grow={false}
|
||||||
customFactors={ratingCustomFactors}
|
>
|
||||||
/>
|
<MissionRating
|
||||||
|
missionId={mission.id}
|
||||||
|
state={ratingState}
|
||||||
|
aggregate={ratingAggregate}
|
||||||
|
customFactors={ratingCustomFactors}
|
||||||
|
/>
|
||||||
|
</TacticalFrame>
|
||||||
|
|
||||||
<Item variant="outline">
|
<TacticalFrame
|
||||||
<ItemHeader>
|
classification="MISSION // DETAILS"
|
||||||
<ItemTitle>Mission Details</ItemTitle>
|
refCode={`REF ${refCodeFrom(mission.id)}`}
|
||||||
</ItemHeader>
|
grow={false}
|
||||||
<ItemContent>
|
>
|
||||||
<div className="grid grid-cols-2 md:grid-cols-3 gap-3 text-sm">
|
<Item variant="outline">
|
||||||
<div>
|
<ItemHeader>
|
||||||
<span className="text-muted-foreground">Type</span>
|
<ItemTitle>Mission Details</ItemTitle>
|
||||||
<p className="font-medium">{mission.classification.missionType}</p>
|
</ItemHeader>
|
||||||
|
<ItemContent>
|
||||||
|
<div className="grid grid-cols-2 md:grid-cols-3 gap-3 text-sm">
|
||||||
|
<div>
|
||||||
|
<span className="text-muted-foreground">Type</span>
|
||||||
|
<p className="font-medium">{mission.classification.missionType}</p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<span className="text-muted-foreground">Operation Type</span>
|
||||||
|
<p className="font-medium capitalize">{mission.operationType}</p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<span className="text-muted-foreground">Max Players</span>
|
||||||
|
<p className="font-medium">{mission.missionRoles?.maxPlayers ?? "-"}</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
</ItemContent>
|
||||||
<span className="text-muted-foreground">Operation Type</span>
|
</Item>
|
||||||
<p className="font-medium capitalize">{mission.operationType}</p>
|
<ReadoutFooter
|
||||||
</div>
|
cells={[
|
||||||
<div>
|
{ label: "Type", value: mission.classification.missionType },
|
||||||
<span className="text-muted-foreground">Max Players</span>
|
{ label: "Op Type", value: mission.operationType },
|
||||||
<p className="font-medium">{mission.missionRoles?.maxPlayers ?? "-"}</p>
|
{ label: "Max Players", value: String(mission.missionRoles?.maxPlayers ?? "-") },
|
||||||
</div>
|
]}
|
||||||
</div>
|
/>
|
||||||
</ItemContent>
|
</TacticalFrame>
|
||||||
</Item>
|
|
||||||
|
|
||||||
<MissionThreatAssessment
|
<TacticalFrame
|
||||||
likelihoods={mission.threatAssessment?.likelihoods ?? null}
|
classification="THREAT // ASSESSMENT"
|
||||||
missionId={mission.id}
|
refCode={`REF ${refCodeFrom(mission.id)}`}
|
||||||
/>
|
grow={false}
|
||||||
|
>
|
||||||
|
<MissionThreatAssessment
|
||||||
|
likelihoods={mission.threatAssessment?.likelihoods ?? null}
|
||||||
|
missionId={mission.id}
|
||||||
|
/>
|
||||||
|
</TacticalFrame>
|
||||||
|
|
||||||
<MissionBriefingSection
|
<TacticalFrame
|
||||||
briefing={mission.briefing ?? null}
|
classification="OPERATIONS // BRIEFING"
|
||||||
missionName={mission.name}
|
refCode={`REF ${refCodeFrom(mission.id)}`}
|
||||||
/>
|
grow={false}
|
||||||
|
>
|
||||||
|
<MissionBriefingSection
|
||||||
|
briefing={mission.briefing ?? null}
|
||||||
|
missionName={mission.name}
|
||||||
|
/>
|
||||||
|
</TacticalFrame>
|
||||||
|
|
||||||
<MissionObjectives
|
<TacticalFrame
|
||||||
objectives={objectives}
|
classification="OBJECTIVES"
|
||||||
missionId={mission.id}
|
refCode={`REF ${refCodeFrom(mission.id)}`}
|
||||||
isEditable={canManage}
|
grow={false}
|
||||||
canReveal={canReveal}
|
>
|
||||||
/>
|
<MissionObjectives
|
||||||
|
objectives={objectives}
|
||||||
|
missionId={mission.id}
|
||||||
|
isEditable={canManage}
|
||||||
|
canReveal={canReveal}
|
||||||
|
/>
|
||||||
|
<ReadoutFooter cells={[{ label: "Obj", value: String(objectives.length) }]} />
|
||||||
|
</TacticalFrame>
|
||||||
|
|
||||||
<MissionFactions factionsInvolved={mission.factionsInvolved ?? null} />
|
<TacticalFrame
|
||||||
|
classification="FACTIONS // INVOLVED"
|
||||||
|
refCode={`REF ${refCodeFrom(mission.id)}`}
|
||||||
|
grow={false}
|
||||||
|
>
|
||||||
|
<MissionFactions factionsInvolved={mission.factionsInvolved ?? null} />
|
||||||
|
</TacticalFrame>
|
||||||
|
|
||||||
<MissionRoles
|
<TacticalFrame
|
||||||
roles={mission.missionRoles?.providedRoles ?? null}
|
classification="ROLES // MANNING"
|
||||||
notes={mission.missionRoles?.notes ?? null}
|
refCode={`REF ${refCodeFrom(mission.id)}`}
|
||||||
maxPlayers={mission.missionRoles?.maxPlayers ?? 32}
|
grow={false}
|
||||||
/>
|
>
|
||||||
|
<MissionRoles
|
||||||
|
roles={mission.missionRoles?.providedRoles ?? null}
|
||||||
|
notes={mission.missionRoles?.notes ?? null}
|
||||||
|
maxPlayers={mission.missionRoles?.maxPlayers ?? 32}
|
||||||
|
/>
|
||||||
|
</TacticalFrame>
|
||||||
|
|
||||||
{commandChainEditor && (
|
{commandChainEditor && (
|
||||||
<MissionCommandChainEditor
|
<TacticalFrame
|
||||||
missionId={mission.id}
|
classification="COMMAND // CHAIN"
|
||||||
mode={commandChainEditor.mode}
|
refCode={`REF ${refCodeFrom(mission.id)}`}
|
||||||
links={commandChainEditor.links}
|
grow={false}
|
||||||
participants={commandChainEditor.participants}
|
>
|
||||||
editable={commandChainEditor.editable}
|
<MissionCommandChainEditor
|
||||||
lockReason={commandChainEditor.lockReason}
|
missionId={mission.id}
|
||||||
/>
|
mode={commandChainEditor.mode}
|
||||||
|
links={commandChainEditor.links}
|
||||||
|
participants={commandChainEditor.participants}
|
||||||
|
editable={commandChainEditor.editable}
|
||||||
|
lockReason={commandChainEditor.lockReason}
|
||||||
|
/>
|
||||||
|
</TacticalFrame>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<MissionRoleSignups
|
<TacticalFrame
|
||||||
missionId={mission.id}
|
classification="SIGN-UPS"
|
||||||
currentUserId={currentUser ? (currentUser.id as number) : null}
|
refCode={`REF ${refCodeFrom(mission.id)}`}
|
||||||
closed={!signupGate.open}
|
grow={false}
|
||||||
closedReason={signupGate.reason ?? null}
|
>
|
||||||
roles={signupRoles}
|
<MissionRoleSignups
|
||||||
mySignup={signupState.mySignup}
|
missionId={mission.id}
|
||||||
canManage={canManage}
|
currentUserId={currentUser ? (currentUser.id as number) : null}
|
||||||
/>
|
closed={!signupGate.open}
|
||||||
|
closedReason={signupGate.reason ?? null}
|
||||||
|
roles={signupRoles}
|
||||||
|
mySignup={signupState.mySignup}
|
||||||
|
canManage={canManage}
|
||||||
|
/>
|
||||||
|
</TacticalFrame>
|
||||||
|
|
||||||
<MissionLogistics logisticsAndSupport={mission.logisticsAndSupport ?? null} />
|
<TacticalFrame
|
||||||
|
classification="LOGISTICS // SUPPORT"
|
||||||
|
refCode={`REF ${refCodeFrom(mission.id)}`}
|
||||||
|
grow={false}
|
||||||
|
>
|
||||||
|
<MissionLogistics logisticsAndSupport={mission.logisticsAndSupport ?? null} />
|
||||||
|
</TacticalFrame>
|
||||||
|
|
||||||
<MissionComms commsAndDocs={mission.commsAndDocs ?? null} />
|
<TacticalFrame
|
||||||
|
classification="COMMS // DOCS"
|
||||||
|
refCode={`REF ${refCodeFrom(mission.id)}`}
|
||||||
|
grow={false}
|
||||||
|
>
|
||||||
|
<MissionComms commsAndDocs={mission.commsAndDocs ?? null} />
|
||||||
|
</TacticalFrame>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* ── Right Sidebar (1/3) ─────────────────────────── */}
|
{/* ── Right Sidebar (1/3) ─────────────────────────── */}
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,9 @@ interface TacticalFrameProps {
|
||||||
footer?: ReactNode;
|
footer?: ReactNode;
|
||||||
/** Corner brackets, default on. Turn off for bar-shaped surfaces. */
|
/** Corner brackets, default on. Turn off for bar-shaped surfaces. */
|
||||||
brackets?: boolean;
|
brackets?: boolean;
|
||||||
|
/** Fill the parent's cross axis (flex-1). Default true; pass false for a
|
||||||
|
* content-height frame (e.g. stacked, non-stretching sections). */
|
||||||
|
grow?: boolean;
|
||||||
className?: string;
|
className?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -38,12 +41,14 @@ export function TacticalFrame({
|
||||||
children,
|
children,
|
||||||
footer,
|
footer,
|
||||||
brackets = true,
|
brackets = true,
|
||||||
|
grow = true,
|
||||||
className,
|
className,
|
||||||
}: TacticalFrameProps) {
|
}: TacticalFrameProps) {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={cn(
|
className={cn(
|
||||||
"group relative flex min-w-0 flex-col overflow-hidden rounded-none border border-border/70 bg-card transition-colors duration-300 hover:border-foreground/30",
|
"group relative flex min-w-0 flex-col overflow-hidden rounded-none border border-border/70 bg-card transition-colors duration-300 hover:border-foreground/30",
|
||||||
|
grow && "flex-1",
|
||||||
className,
|
className,
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue