feat(ui): visual upgrade — sharper, more confident, fewer words
16-file refinement (mono system intact): oversized tight headlines + giant faint mono indices as texture, single shared hairline grids over boxes, wider 8px vertical rhythm, restrained hairline-draw hover micro-interactions, red kept to <=1 per screen. Copy cut to terse, confident Swedish across landing + app screens. Logic/props/ids/contracts preserved; tsc clean, next build green. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
+139
-62
@@ -3,6 +3,7 @@
|
||||
import Link from "next/link";
|
||||
import { useEffect, useState } from "react";
|
||||
import { OrderStepper } from "@/components/order-stepper";
|
||||
import { useReveal } from "@/hooks/use-reveal";
|
||||
import { formatSEK, computeEstimate, type Estimate } from "@/lib/data";
|
||||
|
||||
const FALLBACK: Estimate = computeEstimate({
|
||||
@@ -16,15 +17,16 @@ const FALLBACK: Estimate = computeEstimate({
|
||||
});
|
||||
|
||||
const TRUST = [
|
||||
["Härkomst per fält", "Varje värde bär källa, färskhet och konfidens."],
|
||||
["DPA & GDPR-native", "Databehandlaravtal och dokumenterad laglig grund per fält."],
|
||||
["Din egen data: du pushar", "Read-only roll du själv skapar, tidsbegränsad, raderad efteråt."],
|
||||
["Revisionslogg", "Vad vi rörde, när och varför — fullständigt loggat."],
|
||||
["Härkomst per fält", "Källa, färskhet, konfidens."],
|
||||
["GDPR-native", "DPA och laglig grund per fält."],
|
||||
["Du pushar din data", "Read-only roll. Tidsbegränsad. Raderad efteråt."],
|
||||
["Revisionslogg", "Vad. När. Varför."],
|
||||
];
|
||||
|
||||
export default function DepositPage() {
|
||||
const [est, setEst] = useState<Estimate>(FALLBACK);
|
||||
const [recap, setRecap] = useState<Record<string, string>>({});
|
||||
const reveal = useReveal<HTMLDivElement>();
|
||||
|
||||
useEffect(() => {
|
||||
try {
|
||||
@@ -45,83 +47,158 @@ export default function DepositPage() {
|
||||
return (
|
||||
<main className="min-h-screen bg-background text-foreground">
|
||||
<OrderStepper active={2} />
|
||||
<div className="mx-auto max-w-[80rem] px-6 py-10">
|
||||
<p className="font-mono text-[11px] uppercase tracking-[0.14em] text-muted-foreground">Steg 2 — Förskott</p>
|
||||
<h1 className="mt-3 text-4xl font-medium tracking-[-0.025em] md:text-5xl">Betala 50 %. Resten i depå.</h1>
|
||||
|
||||
<div className="mt-8 grid grid-cols-1 gap-6 lg:grid-cols-[1fr_360px]">
|
||||
<div className="flex flex-col gap-4">
|
||||
<div ref={reveal} className="mx-auto max-w-[80rem] px-6 py-16 md:py-24">
|
||||
{/* header */}
|
||||
<div className="reveal flex items-start justify-between gap-6 border-b border-border pb-8">
|
||||
<div>
|
||||
<p className="font-mono text-[11px] uppercase tracking-[0.16em] text-muted-foreground">
|
||||
Steg 2 — Förskott
|
||||
</p>
|
||||
<h1 className="mt-4 text-5xl font-medium leading-[0.95] tracking-[-0.03em] md:text-7xl">
|
||||
Halva nu.
|
||||
<br />
|
||||
Halva i depå.
|
||||
</h1>
|
||||
</div>
|
||||
<span
|
||||
aria-hidden
|
||||
className="select-none font-mono text-7xl font-medium leading-none tracking-[-0.04em] text-border md:text-8xl"
|
||||
>
|
||||
02
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div className="mt-16 grid grid-cols-1 gap-px bg-border lg:grid-cols-[1fr_360px]">
|
||||
<div className="flex flex-col gap-px bg-border">
|
||||
{/* split */}
|
||||
<div className="border border-border">
|
||||
<div className="border-b border-border px-4 py-2 font-mono text-[11px] uppercase tracking-[0.12em] text-muted-foreground">
|
||||
Betalningsupplägg
|
||||
<section className="reveal bg-background">
|
||||
<div className="flex items-center justify-between border-b border-border px-1 pb-3">
|
||||
<p className="font-mono text-[11px] uppercase tracking-[0.14em] text-muted-foreground">
|
||||
Betalningsupplägg
|
||||
</p>
|
||||
<p className="font-mono text-[11px] uppercase tracking-[0.14em] text-muted-foreground">
|
||||
50 / 50
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2">
|
||||
<div className="border-b border-border p-6 sm:border-b-0 sm:border-r" style={{ backgroundColor: "rgba(228,0,20,0.06)" }}>
|
||||
<p className="font-mono text-[10.5px] uppercase tracking-[0.1em]" style={{ color: "var(--accent-red)" }}>
|
||||
Nu — startar jobbet
|
||||
<div
|
||||
className="group relative border-b border-border p-8 transition-opacity sm:border-b-0 sm:border-r"
|
||||
style={{ backgroundColor: "rgba(228,0,20,0.05)" }}
|
||||
>
|
||||
<p
|
||||
className="font-mono text-[10.5px] uppercase tracking-[0.12em]"
|
||||
style={{ color: "var(--accent-red)" }}
|
||||
>
|
||||
Nu
|
||||
</p>
|
||||
<p
|
||||
className="mt-4 text-5xl font-medium tabular-nums tracking-[-0.02em]"
|
||||
style={{ color: "var(--accent-red)" }}
|
||||
>
|
||||
{formatSEK(est.deposit)}
|
||||
</p>
|
||||
<p className="mt-3 font-mono text-[11px] text-muted-foreground">
|
||||
Startar jobbet. Idag.
|
||||
</p>
|
||||
<p className="mt-2 text-3xl font-medium" style={{ color: "var(--accent-red)" }}>{formatSEK(est.deposit)}</p>
|
||||
<p className="mt-1 font-mono text-[11px] text-muted-foreground">50 % · debiteras idag</p>
|
||||
</div>
|
||||
<div className="p-6">
|
||||
<p className="font-mono text-[10.5px] uppercase tracking-[0.1em] text-muted-foreground">Vid godkänt</p>
|
||||
<p className="mt-2 text-3xl font-medium">{formatSEK(est.remainder)}</p>
|
||||
<p className="mt-1 font-mono text-[11px] text-muted-foreground">50 % · frigörs ur depå</p>
|
||||
<div className="group relative p-8 transition-opacity">
|
||||
<p className="font-mono text-[10.5px] uppercase tracking-[0.12em] text-muted-foreground">
|
||||
Vid godkänt
|
||||
</p>
|
||||
<p className="mt-4 text-5xl font-medium tabular-nums tracking-[-0.02em]">
|
||||
{formatSEK(est.remainder)}
|
||||
</p>
|
||||
<p className="mt-3 font-mono text-[11px] text-muted-foreground">
|
||||
Frigörs ur depå.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="border-t border-border px-6 py-3 text-sm text-muted-foreground">
|
||||
Du debiteras aldrig andra halvan förrän du granskat och tryckt Godkänn.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p className="border-t border-border px-1 pt-3 text-sm text-muted-foreground">
|
||||
Andra halvan rörs först när du tryckt Godkänn.
|
||||
</p>
|
||||
</section>
|
||||
|
||||
{/* trust */}
|
||||
<div className="border border-border">
|
||||
<div className="border-b border-border px-4 py-2 font-mono text-[11px] uppercase tracking-[0.12em] text-muted-foreground">
|
||||
Så hanterar vi data & åtkomst
|
||||
</div>
|
||||
<div className="divide-y divide-border">
|
||||
{TRUST.map(([t, s]) => (
|
||||
<div key={t} className="flex items-start gap-3 px-4 py-3">
|
||||
<span className="mt-0.5 inline-block h-4 w-4 shrink-0 text-center text-xs leading-4" style={{ color: "var(--prov-3)" }}>✓</span>
|
||||
<span>
|
||||
<span className="text-sm font-medium">{t}</span>
|
||||
<span className="ml-2 text-xs text-muted-foreground">{s}</span>
|
||||
<section className="reveal delay-1 bg-background">
|
||||
<p className="border-b border-border px-1 pb-3 font-mono text-[11px] uppercase tracking-[0.14em] text-muted-foreground">
|
||||
Data & åtkomst
|
||||
</p>
|
||||
<dl>
|
||||
{TRUST.map(([t, s], i) => (
|
||||
<div
|
||||
key={t}
|
||||
className="group flex items-baseline gap-4 border-b border-border py-4 transition-colors last:border-b-0"
|
||||
>
|
||||
<span
|
||||
aria-hidden
|
||||
className="w-6 shrink-0 font-mono text-[11px] tabular-nums text-muted-foreground"
|
||||
>
|
||||
{String(i + 1).padStart(2, "0")}
|
||||
</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* summary */}
|
||||
<aside className="lg:sticky lg:top-6 lg:self-start">
|
||||
<div className="border border-border">
|
||||
<div className="border-b border-border px-4 py-2 font-mono text-[11px] uppercase tracking-[0.12em] text-muted-foreground">
|
||||
Din beställning
|
||||
</div>
|
||||
<dl className="divide-y divide-border">
|
||||
{Object.entries(recap).map(([k, v]) => (
|
||||
<div key={k} className="flex items-center justify-between px-4 py-2.5">
|
||||
<dt className="font-mono text-[10.5px] uppercase tracking-[0.08em] text-muted-foreground">{k}</dt>
|
||||
<dd className="max-w-[60%] truncate text-right font-mono text-xs">{v || "—"}</dd>
|
||||
<dt className="w-44 shrink-0 text-sm font-medium tracking-[-0.01em]">{t}</dt>
|
||||
<dd className="text-sm text-muted-foreground">{s}</dd>
|
||||
<span
|
||||
aria-hidden
|
||||
className="ml-auto h-2 w-2 shrink-0 self-center"
|
||||
style={{ backgroundColor: "var(--prov-3)" }}
|
||||
/>
|
||||
</div>
|
||||
))}
|
||||
</dl>
|
||||
<div className="m-4 border p-4" style={{ borderColor: "var(--accent-red)" }}>
|
||||
<p className="font-mono text-[10.5px] uppercase tracking-[0.1em]" style={{ color: "var(--accent-red)" }}>Att betala nu</p>
|
||||
<p className="mt-1 font-mono text-2xl font-medium">{formatSEK(est.deposit)}</p>
|
||||
<p className="mt-1 text-xs text-muted-foreground">exkl. moms · Stripe</p>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
{/* summary */}
|
||||
<aside className="bg-background lg:sticky lg:top-6 lg:self-start">
|
||||
<div className="reveal reveal-right border border-border">
|
||||
<p className="border-b border-border px-4 py-3 font-mono text-[11px] uppercase tracking-[0.14em] text-muted-foreground">
|
||||
Din beställning
|
||||
</p>
|
||||
<dl className="divide-y divide-border">
|
||||
{Object.entries(recap).map(([k, v]) => (
|
||||
<div key={k} className="flex items-center justify-between px-4 py-3">
|
||||
<dt className="font-mono text-[10.5px] uppercase tracking-[0.1em] text-muted-foreground">
|
||||
{k}
|
||||
</dt>
|
||||
<dd className="max-w-[60%] truncate text-right font-mono text-xs tracking-[-0.01em]">
|
||||
{v || "—"}
|
||||
</dd>
|
||||
</div>
|
||||
))}
|
||||
</dl>
|
||||
|
||||
<div className="border-t border-border p-4">
|
||||
<div className="flex items-baseline justify-between">
|
||||
<p
|
||||
className="font-mono text-[10.5px] uppercase tracking-[0.12em]"
|
||||
style={{ color: "var(--accent-red)" }}
|
||||
>
|
||||
Att betala nu
|
||||
</p>
|
||||
<p className="font-mono text-[10.5px] uppercase tracking-[0.1em] text-muted-foreground">
|
||||
exkl. moms · Stripe
|
||||
</p>
|
||||
</div>
|
||||
<p className="mt-2 font-mono text-3xl font-medium tabular-nums tracking-[-0.02em]">
|
||||
{formatSEK(est.deposit)}
|
||||
</p>
|
||||
</div>
|
||||
<div className="p-4 pt-0">
|
||||
|
||||
<div className="border-t border-border p-4">
|
||||
<Link
|
||||
href="/order/SX-4471"
|
||||
className="block w-full bg-foreground py-3.5 text-center font-mono text-[12px] uppercase tracking-[0.1em] text-background transition-colors hover:bg-[var(--accent-red)]"
|
||||
className="block w-full bg-foreground py-4 text-center font-mono text-[12px] uppercase tracking-[0.12em] text-background transition-colors hover:bg-[var(--accent-red)]"
|
||||
>
|
||||
Betala & starta produktion →
|
||||
Betala. Starta. →
|
||||
</Link>
|
||||
<Link href="/bestall" className="mt-3 block text-center font-mono text-[11px] uppercase tracking-[0.08em] text-muted-foreground underline-offset-4 hover:underline">
|
||||
← Tillbaka till konfiguration
|
||||
<Link
|
||||
href="/bestall"
|
||||
className="mt-4 block text-center font-mono text-[11px] uppercase tracking-[0.1em] text-muted-foreground underline-offset-4 transition-colors hover:text-foreground hover:underline"
|
||||
>
|
||||
← Tillbaka
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+57
-39
@@ -78,10 +78,14 @@ export default function ConfiguratorPage() {
|
||||
</button>
|
||||
);
|
||||
|
||||
const Block = ({ label, children }: { label: string; children: React.ReactNode }) => (
|
||||
<div className="border border-border">
|
||||
<div className="border-b border-border px-4 py-2 font-mono text-[11px] uppercase tracking-[0.12em] text-muted-foreground">
|
||||
{label}
|
||||
const Block = ({ index, label, children }: { index: string; label: string; children: React.ReactNode }) => (
|
||||
<div className="group border border-border transition-colors hover:border-foreground">
|
||||
<div className="flex items-center gap-3 border-b border-border px-4 py-2.5">
|
||||
<span className="font-mono text-[11px] tabular-nums text-muted-foreground transition-colors group-hover:text-foreground">
|
||||
{index}
|
||||
</span>
|
||||
<span className="h-3 w-px bg-border" />
|
||||
<span className="font-mono text-[11px] uppercase tracking-[0.12em] text-foreground">{label}</span>
|
||||
</div>
|
||||
<div className="p-4">{children}</div>
|
||||
</div>
|
||||
@@ -91,18 +95,30 @@ export default function ConfiguratorPage() {
|
||||
<main className="min-h-screen bg-background text-foreground">
|
||||
<OrderStepper active={1} />
|
||||
|
||||
<div className="mx-auto max-w-[80rem] px-6 py-10">
|
||||
<p className="font-mono text-[11px] uppercase tracking-[0.14em] text-muted-foreground">
|
||||
Steg 1 — Konfigurera
|
||||
</p>
|
||||
<h1 className="mt-3 text-4xl font-medium tracking-[-0.025em] md:text-5xl">
|
||||
Sätt ihop ditt datajobb.
|
||||
</h1>
|
||||
<div className="mx-auto max-w-[80rem] px-6 py-16">
|
||||
{/* Editorial masthead — oversized index as graphic texture */}
|
||||
<div className="reveal relative border-b border-border pb-10">
|
||||
<span
|
||||
aria-hidden
|
||||
className="pointer-events-none absolute -top-6 right-0 select-none font-mono text-[7rem] leading-none tracking-[-0.04em] text-muted-foreground/10 md:text-[10rem]"
|
||||
>
|
||||
01
|
||||
</span>
|
||||
<p className="font-mono text-[11px] uppercase tracking-[0.18em] text-muted-foreground">
|
||||
Steg 01 / Konfigurera
|
||||
</p>
|
||||
<h1 className="mt-4 max-w-[14ch] text-5xl font-medium leading-[0.95] tracking-[-0.035em] md:text-7xl">
|
||||
Bygg jobbet.
|
||||
</h1>
|
||||
<p className="mt-5 max-w-[34ch] font-mono text-[12px] uppercase tracking-[0.06em] text-muted-foreground">
|
||||
Sju val. Ett pris. Inget gissat.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="mt-8 grid grid-cols-1 gap-6 lg:grid-cols-[1fr_360px]">
|
||||
<div className="mt-12 grid grid-cols-1 gap-6 lg:grid-cols-[1fr_360px]">
|
||||
{/* LEFT — builder */}
|
||||
<div className="flex flex-col gap-4">
|
||||
<Block label="Marknader">
|
||||
<div className="reveal-left flex flex-col gap-4">
|
||||
<Block index="01" label="Marknader">
|
||||
<div className="flex flex-wrap gap-2">
|
||||
{MARKETS.map((m) => (
|
||||
<Chip
|
||||
@@ -117,11 +133,11 @@ export default function ConfiguratorPage() {
|
||||
))}
|
||||
</div>
|
||||
<p className="mt-3 font-mono text-[10.5px] uppercase tracking-[0.08em] text-muted-foreground">
|
||||
Nordiska marknader är live. Övriga markeras "kommande".
|
||||
Norden live. Övriga kommer.
|
||||
</p>
|
||||
</Block>
|
||||
|
||||
<Block label="Typ av poster">
|
||||
<Block index="02" label="Typ av poster">
|
||||
<div className="flex gap-2">
|
||||
{ENTITY_TYPES.map((e) => (
|
||||
<Chip key={e.id} active={type === e.id} onClick={() => setType(e.id)}>
|
||||
@@ -131,7 +147,7 @@ export default function ConfiguratorPage() {
|
||||
</div>
|
||||
</Block>
|
||||
|
||||
<Block label="Fält att inkludera">
|
||||
<Block index="03" label="Fält att inkludera">
|
||||
<div className="flex flex-col">
|
||||
{FIELDS.map((f, i) => {
|
||||
const on = f.locked || fieldIds.includes(f.id);
|
||||
@@ -172,7 +188,7 @@ export default function ConfiguratorPage() {
|
||||
</div>
|
||||
</Block>
|
||||
|
||||
<Block label="Berikning & matchning">
|
||||
<Block index="04" label="Berikning & matchning">
|
||||
<div className="flex flex-wrap gap-2">
|
||||
{ENRICHMENTS.map((e) => (
|
||||
<Chip
|
||||
@@ -187,7 +203,7 @@ export default function ConfiguratorPage() {
|
||||
</Block>
|
||||
|
||||
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2">
|
||||
<Block label="Volym (antal poster)">
|
||||
<Block index="05" label="Volym">
|
||||
<input
|
||||
type="number"
|
||||
min={100}
|
||||
@@ -205,7 +221,7 @@ export default function ConfiguratorPage() {
|
||||
</div>
|
||||
</Block>
|
||||
|
||||
<Block label="Konfidensmål">
|
||||
<Block index="06" label="Konfidensmål">
|
||||
<div className="flex items-baseline justify-between">
|
||||
<span className="font-mono text-2xl" style={{ color: confidenceColor(confidence) }}>
|
||||
{confidence}%
|
||||
@@ -232,7 +248,7 @@ export default function ConfiguratorPage() {
|
||||
</Block>
|
||||
</div>
|
||||
|
||||
<Block label="Leveransformat">
|
||||
<Block index="07" label="Leveransformat">
|
||||
<div className="flex flex-wrap gap-2">
|
||||
{DELIVERY_FORMATS.map((f) => (
|
||||
<Chip key={f} active={formats.includes(f)} onClick={() => toggle(formats, f, setFormats)}>
|
||||
@@ -244,10 +260,12 @@ export default function ConfiguratorPage() {
|
||||
</div>
|
||||
|
||||
{/* RIGHT — sticky summary */}
|
||||
<aside className="lg:sticky lg:top-6 lg:self-start">
|
||||
<aside className="reveal-right lg:sticky lg:top-6 lg:self-start">
|
||||
<div className="border border-border">
|
||||
<div className="border-b border-border px-4 py-2 font-mono text-[11px] uppercase tracking-[0.12em] text-muted-foreground">
|
||||
Sammanfattning
|
||||
<div className="flex items-center gap-3 border-b border-border px-4 py-2.5">
|
||||
<span className="font-mono text-[11px] tabular-nums text-muted-foreground">∑</span>
|
||||
<span className="h-3 w-px bg-border" />
|
||||
<span className="font-mono text-[11px] uppercase tracking-[0.12em] text-foreground">Order</span>
|
||||
</div>
|
||||
<dl className="divide-y divide-border">
|
||||
{[
|
||||
@@ -257,8 +275,8 @@ export default function ConfiguratorPage() {
|
||||
["Berikning", String(enrichmentIds.length)],
|
||||
["Volym", new Intl.NumberFormat("sv-SE").format(volume)],
|
||||
["Frekvens", frequency],
|
||||
["Leveranstid", `≈ ${est.timelineDays} dgr`],
|
||||
["Est. konfidens", `${est.estConfidence}%`],
|
||||
["Leverans", `≈ ${est.timelineDays} dgr`],
|
||||
["Konfidens", `${est.estConfidence}%`],
|
||||
].map(([k, v]) => (
|
||||
<div key={k} className="flex items-center justify-between px-4 py-2.5">
|
||||
<dt className="font-mono text-[10.5px] uppercase tracking-[0.08em] text-muted-foreground">{k}</dt>
|
||||
@@ -267,24 +285,24 @@ export default function ConfiguratorPage() {
|
||||
))}
|
||||
</dl>
|
||||
|
||||
{/* price */}
|
||||
{/* price — oversized numeral */}
|
||||
<div className="border-t border-border p-4">
|
||||
<div className="flex items-baseline justify-between">
|
||||
<span className="font-mono text-[10.5px] uppercase tracking-[0.08em] text-muted-foreground">
|
||||
Totalt arvode{est.recurring ? " /mån" : ""}
|
||||
</span>
|
||||
<span className="text-[34px] font-medium tracking-[-0.02em]">{formatSEK(est.price)}</span>
|
||||
</div>
|
||||
<p className="font-mono text-[10.5px] uppercase tracking-[0.08em] text-muted-foreground">
|
||||
Arvode{est.recurring ? " /mån" : ""}
|
||||
</p>
|
||||
<p className="mt-1 text-[40px] font-medium leading-none tracking-[-0.03em] tabular-nums">
|
||||
{formatSEK(est.price)}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{/* deposit — the only red on this screen */}
|
||||
<div className="m-4 mt-0 border p-4" style={{ borderColor: "var(--accent-red)" }}>
|
||||
<p className="font-mono text-[10.5px] uppercase tracking-[0.1em]" style={{ color: "var(--accent-red)" }}>
|
||||
Förskott 50 % för att starta
|
||||
Förskott · 50 %
|
||||
</p>
|
||||
<p className="mt-1 font-mono text-2xl font-medium">{formatSEK(est.deposit)}</p>
|
||||
<p className="mt-1 text-xs text-muted-foreground">
|
||||
Resterande {formatSEK(est.remainder)} hålls i depå och frigörs vid godkänd leverans.
|
||||
<p className="mt-1 font-mono text-2xl font-medium tabular-nums">{formatSEK(est.deposit)}</p>
|
||||
<p className="mt-2 text-xs text-muted-foreground">
|
||||
Resten i depå. Frigörs vid godkänd leverans.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -293,12 +311,12 @@ export default function ConfiguratorPage() {
|
||||
href="/bestall/forskott"
|
||||
className="block w-full bg-foreground py-3.5 text-center font-mono text-[12px] uppercase tracking-[0.1em] text-background transition-colors hover:bg-[var(--accent-red)]"
|
||||
>
|
||||
Gå till förskott →
|
||||
Betala förskott →
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
<p className="mt-3 text-center font-mono text-[10px] uppercase tracking-[0.08em] text-muted-foreground">
|
||||
Härkomst per fält · GDPR-native · ingen uppgift gissad
|
||||
Källa per fält · GDPR-native · inget gissat
|
||||
</p>
|
||||
</aside>
|
||||
</div>
|
||||
|
||||
+114
-52
@@ -4,6 +4,7 @@ import Link from "next/link";
|
||||
import { useParams } from "next/navigation";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { OrderStepper } from "@/components/order-stepper";
|
||||
import { useReveal } from "@/hooks/use-reveal";
|
||||
|
||||
const STAGES = [
|
||||
{ key: "source", title: "Källracing", meta: "GLEIF · Brreg · CVR · PRH" },
|
||||
@@ -25,6 +26,7 @@ function prefersReduced() {
|
||||
|
||||
export default function ProductionPage() {
|
||||
const { id } = useParams<{ id: string }>();
|
||||
const reveal = useReveal<HTMLDivElement>();
|
||||
const [running, setRunning] = useState(false);
|
||||
const [done, setDone] = useState(false);
|
||||
const [progress, setProgress] = useState<number[]>([0, 0, 0, 0, 0]);
|
||||
@@ -40,7 +42,7 @@ export default function ProductionPage() {
|
||||
setConf(94);
|
||||
setDone(true);
|
||||
setRunning(false);
|
||||
setFeed((f) => [{ t: stamp(), msg: "Leverans klar · konfidens 94 % · 4 980 poster", kind: "ok" }, ...f]);
|
||||
setFeed((f) => [{ t: stamp(), msg: "Levererad. 94 % konfidens. 4 980 poster.", kind: "ok" }, ...f]);
|
||||
};
|
||||
|
||||
const stamp = () => {
|
||||
@@ -55,7 +57,7 @@ export default function ProductionPage() {
|
||||
return;
|
||||
}
|
||||
setRunning(true);
|
||||
setFeed([{ t: "00:00", msg: `Order ${id} startad · depå mottagen`, kind: "run" }]);
|
||||
setFeed([{ t: "00:00", msg: `Order ${id}. Depå mottagen.`, kind: "run" }]);
|
||||
timer.current = setInterval(() => {
|
||||
tick.current += 1;
|
||||
setProgress((prev) => {
|
||||
@@ -64,7 +66,7 @@ export default function ProductionPage() {
|
||||
if (i === -1) return prev;
|
||||
next[i] = Math.min(100, next[i] + 8 + Math.random() * 10);
|
||||
if (next[i] >= 100 && i < STAGES.length) {
|
||||
setFeed((f) => [{ t: stamp(), msg: `${STAGES[i].title} klar`, kind: "ok" }, ...f].slice(0, 12));
|
||||
setFeed((f) => [{ t: stamp(), msg: `${STAGES[i].title}. Klar.`, kind: "ok" }, ...f].slice(0, 12));
|
||||
}
|
||||
return next;
|
||||
});
|
||||
@@ -81,97 +83,154 @@ export default function ProductionPage() {
|
||||
useEffect(() => () => { if (timer.current) clearInterval(timer.current); }, []);
|
||||
|
||||
const overall = Math.round(progress.reduce((a, b) => a + b, 0) / STAGES.length);
|
||||
const status = done ? "Levererad" : running ? `${overall} %` : "Väntar";
|
||||
|
||||
return (
|
||||
<main className="min-h-screen bg-background text-foreground">
|
||||
<OrderStepper active={3} />
|
||||
<div className="mx-auto max-w-[80rem] px-6 py-10">
|
||||
<p className="font-mono text-[11px] uppercase tracking-[0.14em] text-muted-foreground">Steg 3 — Produktion</p>
|
||||
<h1 className="mt-3 text-4xl font-medium tracking-[-0.025em] md:text-5xl">Följ jobbet — i realtid.</h1>
|
||||
|
||||
{/* control row */}
|
||||
<div className="mt-6 flex flex-wrap items-center gap-3">
|
||||
<div ref={reveal} className="mx-auto max-w-[80rem] px-6">
|
||||
{/* masthead — oversized numeral as graphic texture */}
|
||||
<header className="relative border-b border-border py-16 md:py-20">
|
||||
<span
|
||||
aria-hidden
|
||||
className="pointer-events-none absolute -top-6 right-0 select-none font-mono text-[clamp(7rem,18vw,15rem)] font-medium leading-none tracking-[-0.04em] text-foreground/[0.04]"
|
||||
>
|
||||
03
|
||||
</span>
|
||||
<p className="reveal font-mono text-[11px] uppercase tracking-[0.18em] text-muted-foreground">
|
||||
Steg 03 — Produktion
|
||||
</p>
|
||||
<h1 className="reveal delay-1 mt-5 max-w-[18ch] text-[clamp(2.6rem,7vw,5.5rem)] font-medium leading-[0.95] tracking-[-0.035em]">
|
||||
Se det hända.
|
||||
</h1>
|
||||
<p className="reveal delay-2 mt-5 font-mono text-sm text-muted-foreground">
|
||||
Live. Källa för källa.
|
||||
</p>
|
||||
</header>
|
||||
|
||||
{/* control row — single shared baseline */}
|
||||
<div className="reveal delay-2 flex flex-wrap items-stretch gap-px border-b border-border bg-border">
|
||||
<button
|
||||
type="button"
|
||||
onClick={start}
|
||||
disabled={running || done}
|
||||
className="bg-foreground px-5 py-3 font-mono text-[12px] uppercase tracking-[0.1em] text-background transition-colors hover:bg-[var(--accent-red)] disabled:opacity-40"
|
||||
className="group flex items-center gap-3 bg-background px-6 py-5 font-mono text-[12px] uppercase tracking-[0.12em] transition-colors hover:bg-foreground hover:text-background disabled:opacity-40 disabled:hover:bg-background disabled:hover:text-foreground"
|
||||
>
|
||||
{done ? "✓ Klart" : running ? "Kör…" : "▸ Starta simulering"}
|
||||
<span className="text-[var(--accent-red)] transition-colors group-hover:text-background group-disabled:text-foreground">
|
||||
{done ? "✓" : running ? "●" : "▸"}
|
||||
</span>
|
||||
{done ? "Klar" : running ? "Kör" : "Starta"}
|
||||
</button>
|
||||
<span className="border border-border px-3 py-2 font-mono text-[11px] uppercase tracking-[0.08em] text-muted-foreground">
|
||||
Order {id} · {done ? "klar" : running ? `${overall}%` : "väntar"}
|
||||
<span className="flex flex-1 items-center bg-background px-6 py-5 font-mono text-[11px] uppercase tracking-[0.1em] text-muted-foreground">
|
||||
Order {id}
|
||||
</span>
|
||||
<span className="border border-border px-3 py-2 font-mono text-[11px] uppercase tracking-[0.08em] text-muted-foreground">
|
||||
ETA ≈ 4 dgr (simulerad)
|
||||
<span className="flex items-center gap-3 bg-background px-6 py-5 font-mono text-[11px] uppercase tracking-[0.1em]">
|
||||
<span className="text-muted-foreground">Status</span>
|
||||
<span className="tabular-nums text-foreground">{status}</span>
|
||||
</span>
|
||||
<span className="flex items-center gap-3 bg-background px-6 py-5 font-mono text-[11px] uppercase tracking-[0.1em]">
|
||||
<span className="text-muted-foreground">ETA</span>
|
||||
<span className="tabular-nums text-foreground">≈ 4 dgr</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div className="mt-8 grid grid-cols-1 gap-6 lg:grid-cols-[1fr_320px]">
|
||||
{/* stages */}
|
||||
<div className="flex flex-col gap-3">
|
||||
<div className="grid grid-cols-1 lg:grid-cols-[1fr_340px]">
|
||||
{/* stages — numbered ledger, hairline-separated */}
|
||||
<div className="reveal-left delay-1 border-border lg:border-r">
|
||||
{STAGES.map((s, i) => {
|
||||
const p = Math.round(progress[i]);
|
||||
const isDone = p >= 100;
|
||||
const isRun = !isDone && (i === 0 || progress[i - 1] >= 100) && running;
|
||||
const color = isDone ? "var(--prov-3)" : isRun ? "var(--accent-red)" : "var(--border)";
|
||||
const accent = isDone ? "var(--prov-3)" : isRun ? "var(--accent-red)" : "var(--muted-foreground)";
|
||||
return (
|
||||
<div key={s.key} className="border p-4" style={{ borderColor: color }}>
|
||||
<div className="flex items-center justify-between">
|
||||
<span className="text-sm font-medium">{s.title}</span>
|
||||
<span className="font-mono text-xs text-muted-foreground">{p}%</span>
|
||||
<div
|
||||
key={s.key}
|
||||
className="group relative border-b border-border py-7 pl-6 pr-6 transition-colors hover:bg-secondary/40"
|
||||
>
|
||||
{/* state marker rail */}
|
||||
<span
|
||||
aria-hidden
|
||||
className="absolute left-0 top-0 h-full w-px transition-all"
|
||||
style={{ backgroundColor: isDone || isRun ? accent : "transparent" }}
|
||||
/>
|
||||
<div className="flex items-baseline justify-between gap-4">
|
||||
<div className="flex items-baseline gap-4">
|
||||
<span className="font-mono text-[11px] tabular-nums text-muted-foreground">
|
||||
{String(i + 1).padStart(2, "0")}
|
||||
</span>
|
||||
<span className="text-base font-medium tracking-[-0.01em]">{s.title}</span>
|
||||
</div>
|
||||
<span className="font-mono text-sm tabular-nums" style={{ color: accent }}>
|
||||
{p}%
|
||||
</span>
|
||||
</div>
|
||||
<div className="mt-2 h-1.5 w-full bg-secondary">
|
||||
<div className="h-full transition-all" style={{ width: `${p}%`, backgroundColor: isDone ? "var(--prov-3)" : "var(--foreground)" }} />
|
||||
<div className="mt-4 h-px w-full bg-border">
|
||||
<div
|
||||
className="h-px transition-all duration-300"
|
||||
style={{ width: `${p}%`, backgroundColor: isDone ? "var(--prov-3)" : "var(--foreground)" }}
|
||||
/>
|
||||
</div>
|
||||
<p className="mt-2 font-mono text-[10.5px] uppercase tracking-[0.06em] text-muted-foreground">{s.meta}</p>
|
||||
<p className="mt-3 pl-10 font-mono text-[10.5px] uppercase tracking-[0.08em] text-muted-foreground">
|
||||
{s.meta}
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
|
||||
{/* right column */}
|
||||
<div className="flex flex-col gap-4">
|
||||
<div className="border border-border p-5 text-center">
|
||||
{/* right column — gauge, markets, feed */}
|
||||
<aside className="reveal-right delay-2 flex flex-col">
|
||||
{/* confidence gauge */}
|
||||
<div className="border-b border-border px-6 py-10 text-center">
|
||||
<ConfidenceRing value={conf} />
|
||||
<p className="mt-2 font-mono text-[10.5px] uppercase tracking-[0.1em] text-muted-foreground">Levererbart</p>
|
||||
<p className="mt-5 font-mono text-[10.5px] uppercase tracking-[0.14em] text-muted-foreground">
|
||||
Konfidens — levererbart
|
||||
</p>
|
||||
</div>
|
||||
<div className="border border-border p-4">
|
||||
<p className="font-mono text-[10.5px] uppercase tracking-[0.1em] text-muted-foreground">Per marknad</p>
|
||||
<div className="mt-3 flex flex-col gap-2">
|
||||
|
||||
{/* per market */}
|
||||
<div className="border-b border-border px-6 py-7">
|
||||
<p className="font-mono text-[10.5px] uppercase tracking-[0.14em] text-muted-foreground">Per marknad</p>
|
||||
<div className="mt-5 flex flex-col gap-3.5">
|
||||
{MARKET_KEYS.map((m, i) => (
|
||||
<div key={m.code} className="flex items-center gap-2">
|
||||
<span className="w-7 font-mono text-xs">{m.code}</span>
|
||||
<div className="h-1.5 flex-1 bg-secondary">
|
||||
<div className="h-full bg-foreground transition-all" style={{ width: `${Math.round(markets[i])}%` }} />
|
||||
<div key={m.code} className="flex items-center gap-3">
|
||||
<span className="w-7 font-mono text-xs tabular-nums">{m.code}</span>
|
||||
<div className="h-px flex-1 bg-border">
|
||||
<div className="h-px bg-foreground transition-all duration-300" style={{ width: `${Math.round(markets[i])}%` }} />
|
||||
</div>
|
||||
<span className="w-9 text-right font-mono text-[10.5px] text-muted-foreground">{Math.round(markets[i])}%</span>
|
||||
<span className="w-10 text-right font-mono text-[10.5px] tabular-nums text-muted-foreground">
|
||||
{Math.round(markets[i])}%
|
||||
</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
<div className="border border-border p-4">
|
||||
<p className="font-mono text-[10.5px] uppercase tracking-[0.1em] text-muted-foreground">Aktivitet</p>
|
||||
<div className="mt-3 flex flex-col gap-1.5 font-mono text-[11px]">
|
||||
{feed.length === 0 ? <span className="text-muted-foreground">— väntar på start —</span> : null}
|
||||
|
||||
{/* activity */}
|
||||
<div className="px-6 py-7">
|
||||
<p className="font-mono text-[10.5px] uppercase tracking-[0.14em] text-muted-foreground">Aktivitet</p>
|
||||
<div className="mt-5 flex flex-col gap-2 font-mono text-[11px] leading-relaxed">
|
||||
{feed.length === 0 ? <span className="text-muted-foreground">Inget än.</span> : null}
|
||||
{feed.map((f, i) => (
|
||||
<div key={i} className="flex gap-2">
|
||||
<span className="text-muted-foreground">{f.t}</span>
|
||||
<div key={i} className="flex gap-3">
|
||||
<span className="tabular-nums text-muted-foreground">{f.t}</span>
|
||||
<span style={{ color: f.kind === "ok" ? "var(--prov-3)" : "var(--accent-red)" }}>{f.msg}</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
</div>
|
||||
|
||||
{done ? (
|
||||
<div className="mt-8">
|
||||
<div className="border-t border-border py-12">
|
||||
<Link
|
||||
href={`/order/${id}/validera`}
|
||||
className="inline-block bg-foreground px-6 py-3.5 font-mono text-[12px] uppercase tracking-[0.1em] text-background transition-colors hover:bg-[var(--accent-red)]"
|
||||
className="group inline-flex items-center gap-3 bg-foreground px-7 py-4 font-mono text-[12px] uppercase tracking-[0.12em] text-background transition-colors hover:bg-[var(--accent-red)]"
|
||||
>
|
||||
Granska & validera resultatet →
|
||||
Granska resultatet
|
||||
<span className="transition-transform duration-300 group-hover:translate-x-1">→</span>
|
||||
</Link>
|
||||
</div>
|
||||
) : null}
|
||||
@@ -185,15 +244,18 @@ function ConfidenceRing({ value }: { value: number }) {
|
||||
const c = 2 * Math.PI * r;
|
||||
const off = c - (value / 100) * c;
|
||||
return (
|
||||
<svg viewBox="0 0 130 130" className="mx-auto h-36 w-36">
|
||||
<circle cx="65" cy="65" r={r} fill="none" stroke="var(--secondary)" strokeWidth="8" />
|
||||
<svg viewBox="0 0 130 130" className="mx-auto h-40 w-40">
|
||||
<circle cx="65" cy="65" r={r} fill="none" stroke="var(--secondary)" strokeWidth="6" />
|
||||
<circle
|
||||
cx="65" cy="65" r={r} fill="none" stroke="var(--prov-3)" strokeWidth="8"
|
||||
cx="65" cy="65" r={r} fill="none" stroke="var(--prov-3)" strokeWidth="6"
|
||||
strokeDasharray={c} strokeDashoffset={off} strokeLinecap="butt"
|
||||
transform="rotate(-90 65 65)" style={{ transition: "stroke-dashoffset .3s" }}
|
||||
/>
|
||||
<text x="65" y="72" textAnchor="middle" className="fill-foreground font-mono" style={{ fontSize: 24 }}>
|
||||
{Math.round(value)}%
|
||||
<text x="65" y="64" textAnchor="middle" className="fill-foreground font-mono" style={{ fontSize: 30, letterSpacing: "-0.02em" }}>
|
||||
{Math.round(value)}
|
||||
</text>
|
||||
<text x="65" y="84" textAnchor="middle" className="fill-muted-foreground font-mono" style={{ fontSize: 10, letterSpacing: "0.14em" }}>
|
||||
PROCENT
|
||||
</text>
|
||||
</svg>
|
||||
);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import { useParams } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { OrderStepper } from "@/components/order-stepper";
|
||||
import { useReveal } from "@/hooks/use-reveal";
|
||||
import { CellProvenance, ProvenanceBadge, PROVENANCE_LEGEND } from "@/components/provenance-badge";
|
||||
import { MARKETS, SAMPLE_ROWS, formatSEK } from "@/lib/data";
|
||||
|
||||
@@ -31,37 +32,64 @@ export default function ValidationPage() {
|
||||
const [tab, setTab] = useState<Tab>("Tabell");
|
||||
const [dests, setDests] = useState<string[]>(["CSV", "Tabellvy (NocoDB)"]);
|
||||
const [approved, setApproved] = useState(false);
|
||||
const ref = useReveal<HTMLElement>();
|
||||
|
||||
const toggleDest = (d: string) => setDests((p) => (p.includes(d) ? p.filter((x) => x !== d) : [...p, d]));
|
||||
|
||||
return (
|
||||
<main className="min-h-screen bg-background text-foreground">
|
||||
<main ref={ref} className="min-h-screen bg-background text-foreground">
|
||||
<OrderStepper active={4} />
|
||||
<div className="mx-auto max-w-[80rem] px-6 py-10">
|
||||
<p className="font-mono text-[11px] uppercase tracking-[0.14em] text-muted-foreground">Steg 4 — Validera & leverera</p>
|
||||
<h1 className="mt-3 text-4xl font-medium tracking-[-0.025em] md:text-5xl">Granska allt. Godkänn fritt.</h1>
|
||||
|
||||
{/* header — oversized faint numeral as graphic texture */}
|
||||
<div className="relative overflow-hidden border-b border-border">
|
||||
<span
|
||||
aria-hidden
|
||||
className="pointer-events-none absolute -right-3 -top-6 select-none font-mono text-[clamp(7rem,22vw,15rem)] font-medium leading-none tracking-[-0.05em] text-secondary"
|
||||
>
|
||||
04
|
||||
</span>
|
||||
<div className="relative mx-auto max-w-[80rem] px-6 py-16 md:py-24">
|
||||
<div className="reveal flex items-center gap-3">
|
||||
<span aria-hidden className="animate-float inline-block h-2 w-2" style={{ backgroundColor: "var(--accent-red)" }} />
|
||||
<p className="font-mono text-[11px] uppercase tracking-[0.16em] text-muted-foreground">Steg 04 — Validera</p>
|
||||
</div>
|
||||
<h1 className="reveal delay-1 mt-6 max-w-3xl text-[clamp(2.4rem,6vw,4.5rem)] font-medium leading-[0.95] tracking-[-0.035em]">
|
||||
Granska allt.
|
||||
<br />
|
||||
Godkänn fritt.
|
||||
</h1>
|
||||
<p className="reveal delay-2 mt-6 font-mono text-[11px] uppercase tracking-[0.1em] text-muted-foreground">
|
||||
Källan syns. Alltid. Inget gissat.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="mx-auto max-w-[80rem] px-6 py-12">
|
||||
{/* tabs */}
|
||||
<div className="mt-8 flex flex-wrap gap-0 border-b border-border">
|
||||
{TABS.map((t) => (
|
||||
<div className="reveal flex flex-wrap border-b border-border">
|
||||
{TABS.map((t, i) => (
|
||||
<button
|
||||
key={t}
|
||||
onClick={() => setTab(t)}
|
||||
className="px-4 py-3 font-mono text-[11px] uppercase tracking-[0.1em] transition-colors"
|
||||
style={{
|
||||
color: tab === t ? "var(--foreground)" : "var(--muted-foreground)",
|
||||
borderBottom: tab === t ? "2px solid var(--accent-red)" : "2px solid transparent",
|
||||
}}
|
||||
className="group relative -mb-px px-5 py-3.5 font-mono text-[11px] uppercase tracking-[0.12em] transition-colors"
|
||||
style={{ color: tab === t ? "var(--foreground)" : "var(--muted-foreground)" }}
|
||||
>
|
||||
<span className="mr-2 text-muted-foreground">{String(i + 1).padStart(2, "0")}</span>
|
||||
{t}
|
||||
<span
|
||||
aria-hidden
|
||||
className="absolute bottom-0 left-0 h-px bg-foreground transition-all duration-300 ease-out"
|
||||
style={{ width: tab === t ? "100%" : "0%" }}
|
||||
/>
|
||||
<span aria-hidden className="absolute bottom-0 left-0 h-px w-0 bg-border transition-[width] duration-300 ease-out group-hover:w-full" />
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className="mt-6">
|
||||
<div className="mt-10">
|
||||
{tab === "Tabell" ? (
|
||||
<div>
|
||||
<div className="mb-4 flex flex-wrap gap-2">
|
||||
<div className="reveal-fade">
|
||||
<div className="mb-5 flex flex-wrap gap-2">
|
||||
{PROVENANCE_LEGEND.map((l) => (
|
||||
<ProvenanceBadge key={l.level} level={l.level} source={l.text} />
|
||||
))}
|
||||
@@ -71,37 +99,41 @@ export default function ValidationPage() {
|
||||
<thead>
|
||||
<tr className="border-b border-border bg-secondary">
|
||||
{["Org.nr", "Bolag", "Säte", "SNI", "Anställda", "Oms. (tkr)", "E-post", "LEI"].map((h) => (
|
||||
<th key={h} className="px-3 py-2 text-left font-mono text-[10.5px] uppercase tracking-[0.08em] text-muted-foreground">{h}</th>
|
||||
<th key={h} className="px-3 py-2.5 text-left font-mono text-[10px] uppercase tracking-[0.1em] text-muted-foreground">{h}</th>
|
||||
))}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{SAMPLE_ROWS.map((r) => (
|
||||
<tr key={r.orgnr} className="border-b border-border last:border-b-0 hover:bg-secondary/50">
|
||||
<td className="px-3 py-2 font-mono text-xs">{r.orgnr}<CellProvenance level={3} /></td>
|
||||
<td className="px-3 py-2">{r.bolag}<CellProvenance level={3} /></td>
|
||||
<td className="px-3 py-2">{r.sate}<CellProvenance level={3} /></td>
|
||||
<td className="px-3 py-2 font-mono text-xs">{r.sni}<CellProvenance level={2} /></td>
|
||||
<td className="px-3 py-2 font-mono text-xs">{new Intl.NumberFormat("sv-SE").format(r.anstallda)}<CellProvenance level={2} /></td>
|
||||
<td className="px-3 py-2 font-mono text-xs">{new Intl.NumberFormat("sv-SE").format(r.oms)}<CellProvenance level={2} /></td>
|
||||
<td className="px-3 py-2 text-xs">
|
||||
<tr key={r.orgnr} className="border-b border-border transition-colors last:border-b-0 hover:bg-secondary/60">
|
||||
<td className="px-3 py-2.5 font-mono text-xs">{r.orgnr}<CellProvenance level={3} /></td>
|
||||
<td className="px-3 py-2.5">{r.bolag}<CellProvenance level={3} /></td>
|
||||
<td className="px-3 py-2.5">{r.sate}<CellProvenance level={3} /></td>
|
||||
<td className="px-3 py-2.5 font-mono text-xs">{r.sni}<CellProvenance level={2} /></td>
|
||||
<td className="px-3 py-2.5 font-mono text-xs">{new Intl.NumberFormat("sv-SE").format(r.anstallda)}<CellProvenance level={2} /></td>
|
||||
<td className="px-3 py-2.5 font-mono text-xs">{new Intl.NumberFormat("sv-SE").format(r.oms)}<CellProvenance level={2} /></td>
|
||||
<td className="px-3 py-2.5 text-xs">
|
||||
{r.epost ? (<>{r.epost}<CellProvenance level={r.epostLevel} /></>) : (<span className="text-muted-foreground">— licens (FI)<CellProvenance level={0} /></span>)}
|
||||
</td>
|
||||
<td className="px-3 py-2 font-mono text-xs">{r.lei}<CellProvenance level={3} /></td>
|
||||
<td className="px-3 py-2.5 font-mono text-xs">{r.lei}<CellProvenance level={3} /></td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p className="mt-4 font-mono text-[10.5px] uppercase tracking-[0.08em] text-muted-foreground">
|
||||
Varje cell bär sin källa. Tom = licens, aldrig gissning.
|
||||
</p>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{tab === "Täckning" ? (
|
||||
<div>
|
||||
<div className="reveal-fade">
|
||||
<p className="mb-4 font-mono text-[10.5px] uppercase tracking-[0.12em] text-muted-foreground">Per marknad</p>
|
||||
<div className="grid grid-cols-[repeat(auto-fill,minmax(96px,1fr))] gap-px bg-border">
|
||||
{MARKETS.filter((m) => m.live).map((m) => (
|
||||
<div key={m.code} className="bg-background p-3">
|
||||
<p className="font-mono text-sm font-semibold">{m.code}</p>
|
||||
<div key={m.code} className="group bg-background p-3 transition-colors hover:bg-secondary/40">
|
||||
<p className="font-mono text-sm font-semibold tracking-[-0.01em]">{m.code}</p>
|
||||
<p className="font-mono text-[10.5px] text-muted-foreground">{m.coverage}%</p>
|
||||
<div className="mt-2 h-1 w-full bg-secondary">
|
||||
<div className="h-full" style={{ width: `${m.coverage}%`, backgroundColor: m.coverage >= 95 ? "var(--prov-3)" : "var(--prov-2)" }} />
|
||||
@@ -109,11 +141,11 @@ export default function ValidationPage() {
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
<div className="mt-4 grid grid-cols-1 gap-px bg-border sm:grid-cols-3">
|
||||
{[["4 980", "poster levererade"], ["20", "utelämnade — ej gissade"], ["3,2", "källor per bekräftat fält"]].map(([n, l]) => (
|
||||
<div key={l} className="bg-background p-5">
|
||||
<p className="text-3xl font-medium">{n}</p>
|
||||
<p className="mt-1 font-mono text-[10.5px] uppercase tracking-[0.08em] text-muted-foreground">{l}</p>
|
||||
<div className="mt-px grid grid-cols-1 gap-px bg-border sm:grid-cols-3">
|
||||
{[["4 980", "poster levererade"], ["20", "utelämnade — ej gissade"], ["3,2", "källor per fält"]].map(([n, l]) => (
|
||||
<div key={l} className="bg-background p-6">
|
||||
<p className="text-4xl font-medium tracking-[-0.03em]">{n}</p>
|
||||
<p className="mt-2 font-mono text-[10.5px] uppercase tracking-[0.1em] text-muted-foreground">{l}</p>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
@@ -121,44 +153,45 @@ export default function ValidationPage() {
|
||||
) : null}
|
||||
|
||||
{tab === "Schema & arkitektur" ? (
|
||||
<div className="border border-border p-6" style={{ backgroundImage: "radial-gradient(var(--border) 1px, transparent 1px)", backgroundSize: "16px 16px" }}>
|
||||
<div className="reveal-fade border border-border p-6 md:p-8" style={{ backgroundImage: "radial-gradient(var(--border) 1px, transparent 1px)", backgroundSize: "16px 16px" }}>
|
||||
<p className="mb-6 font-mono text-[10.5px] uppercase tracking-[0.12em] text-muted-foreground">Stjärnschema · spårbart per fält</p>
|
||||
<div className="grid grid-cols-2 gap-4 md:grid-cols-3">
|
||||
{ENTITIES.map((e) => (
|
||||
<div key={e.name} className="bg-background" style={{ border: e.key ? "1px solid var(--accent-red)" : "1px solid var(--border)" }}>
|
||||
<div className="border-b border-border px-3 py-2 font-mono text-[11px]">{e.name}</div>
|
||||
<ul className="px-3 py-2 font-mono text-[10.5px] text-muted-foreground">
|
||||
<div key={e.name} className="group bg-background transition-[border-color]" style={{ border: e.key ? "1px solid var(--accent-red)" : "1px solid var(--border)" }}>
|
||||
<div className="border-b border-border px-3 py-2 font-mono text-[11px] tracking-[0.02em]">{e.name}</div>
|
||||
<ul className="px-3 py-2 font-mono text-[10.5px] leading-relaxed text-muted-foreground">
|
||||
{e.cols.map((c) => (<li key={c}>{c}</li>))}
|
||||
</ul>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
<p className="mt-4 font-mono text-[10.5px] uppercase tracking-[0.06em] text-muted-foreground">
|
||||
→ varje fält länkar till bridge_provenance · ingen uppgift utan spårbar källa
|
||||
<p className="mt-6 border-t border-border pt-4 font-mono text-[10.5px] uppercase tracking-[0.08em] text-muted-foreground">
|
||||
Varje fält → bridge_provenance. Ingen uppgift utan källa.
|
||||
</p>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{tab === "Kvalitetsrapport" ? (
|
||||
<div className="grid grid-cols-1 gap-4 md:grid-cols-2">
|
||||
<div className="border border-border p-5">
|
||||
<p className="font-mono text-[10.5px] uppercase tracking-[0.1em] text-muted-foreground">Per dimension</p>
|
||||
<div className="mt-4 flex flex-col gap-3">
|
||||
<div className="reveal-fade grid grid-cols-1 gap-px bg-border md:grid-cols-2">
|
||||
<div className="bg-background p-6">
|
||||
<p className="font-mono text-[10.5px] uppercase tracking-[0.12em] text-muted-foreground">Per dimension</p>
|
||||
<div className="mt-5 flex flex-col gap-4">
|
||||
{DIMENSIONS.map(([name, v, amber]) => (
|
||||
<div key={name}>
|
||||
<div className="flex justify-between font-mono text-xs"><span>{name}</span><span className="text-muted-foreground">{v}%</span></div>
|
||||
<div className="mt-1 h-1.5 w-full bg-secondary">
|
||||
<div className="mt-1.5 h-1.5 w-full bg-secondary">
|
||||
<div className="h-full" style={{ width: `${v}%`, backgroundColor: amber ? "var(--prov-2)" : "var(--prov-3)" }} />
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
<div className="border border-border p-5">
|
||||
<p className="font-mono text-[10.5px] uppercase tracking-[0.1em] text-muted-foreground">Kontroller som passerade</p>
|
||||
<ul className="mt-4 flex flex-col gap-2 text-sm">
|
||||
<div className="bg-background p-6">
|
||||
<p className="font-mono text-[10.5px] uppercase tracking-[0.12em] text-muted-foreground">Passerade kontroller</p>
|
||||
<ul className="mt-5 flex flex-col gap-2.5 text-sm">
|
||||
{CHECKS.map((c) => (
|
||||
<li key={c} className="flex items-start gap-2">
|
||||
<span style={{ color: "var(--prov-3)" }}>✓</span>
|
||||
<li key={c} className="flex items-start gap-2.5">
|
||||
<span aria-hidden className="mt-1.5 inline-block h-[9px] w-[9px] flex-shrink-0" style={{ backgroundColor: "var(--prov-3)" }} />
|
||||
<span>{c}</span>
|
||||
</li>
|
||||
))}
|
||||
@@ -169,20 +202,20 @@ export default function ValidationPage() {
|
||||
</div>
|
||||
|
||||
{/* destinations */}
|
||||
<div className="mt-8">
|
||||
<p className="font-mono text-[10.5px] uppercase tracking-[0.1em] text-muted-foreground">Leverera till</p>
|
||||
<div className="mt-3 flex flex-wrap gap-2">
|
||||
<div className="reveal mt-14 border-t border-border pt-8">
|
||||
<p className="font-mono text-[10.5px] uppercase tracking-[0.12em] text-muted-foreground">Leverera till</p>
|
||||
<div className="mt-4 flex flex-wrap gap-2">
|
||||
{DESTINATIONS.map((d) => {
|
||||
const on = dests.includes(d);
|
||||
return (
|
||||
<button
|
||||
key={d}
|
||||
onClick={() => toggleDest(d)}
|
||||
className="border px-3 py-2 font-mono text-[11px] uppercase tracking-[0.08em] transition-colors"
|
||||
className="border px-3.5 py-2 font-mono text-[11px] uppercase tracking-[0.08em] transition-colors hover:border-foreground"
|
||||
style={{
|
||||
borderColor: on ? "var(--accent-red)" : "var(--border)",
|
||||
backgroundColor: on ? "rgba(228,0,20,0.06)" : "transparent",
|
||||
color: "var(--foreground)",
|
||||
borderColor: on ? "var(--foreground)" : "var(--border)",
|
||||
backgroundColor: on ? "var(--foreground)" : "transparent",
|
||||
color: on ? "var(--background)" : "var(--foreground)",
|
||||
}}
|
||||
>
|
||||
{d}
|
||||
@@ -193,28 +226,32 @@ export default function ValidationPage() {
|
||||
</div>
|
||||
|
||||
{/* action bar */}
|
||||
<div className="mt-8 border border-border p-5">
|
||||
<div className="reveal mt-8 border border-border p-6 md:p-8">
|
||||
{approved ? (
|
||||
<div className="border p-4" style={{ borderColor: "var(--prov-3)" }}>
|
||||
<p className="font-mono text-sm" style={{ color: "var(--prov-3)" }}>
|
||||
✓ Leverans godkänd. Slutbetalning frigjord. Export upplåst.
|
||||
<div className="border p-5" style={{ borderColor: "var(--prov-3)" }}>
|
||||
<p className="flex items-center gap-2.5 font-mono text-sm" style={{ color: "var(--prov-3)" }}>
|
||||
<span aria-hidden className="inline-block h-[9px] w-[9px]" style={{ backgroundColor: "var(--prov-3)" }} />
|
||||
Godkänd. Slutbetalning frigjord. Export upplåst.
|
||||
</p>
|
||||
<p className="mt-1 text-xs text-muted-foreground">Order {id} · levererad till {dests.join(" · ") || "—"}.</p>
|
||||
<p className="mt-2 font-mono text-[11px] tracking-[0.02em] text-muted-foreground">Order {id} · {dests.join(" · ") || "—"}.</p>
|
||||
</div>
|
||||
) : (
|
||||
<div className="flex flex-col gap-4 md:flex-row md:items-center md:justify-between">
|
||||
<p className="max-w-xl text-sm text-muted-foreground">
|
||||
Godkänn leveransen — frigör resterande belopp ur depån och lås upp full export. Inte nöjd? Begär revidering utan kostnad.
|
||||
</p>
|
||||
<div className="flex gap-3">
|
||||
<div className="flex flex-col gap-6 md:flex-row md:items-center md:justify-between">
|
||||
<div>
|
||||
<p className="text-lg font-medium tracking-[-0.02em]">Nöjd? Frigör hälften.</p>
|
||||
<p className="mt-1.5 max-w-md font-mono text-[11px] uppercase leading-relaxed tracking-[0.06em] text-muted-foreground">
|
||||
Godkänn → depån släpper resten. Full export. Annars: revidering, utan kostnad.
|
||||
</p>
|
||||
</div>
|
||||
<div className="flex flex-shrink-0 gap-3">
|
||||
<button className="border border-foreground px-5 py-3 font-mono text-[12px] uppercase tracking-[0.1em] transition-colors hover:bg-foreground hover:text-background">
|
||||
Begär revidering
|
||||
Revidera
|
||||
</button>
|
||||
<button
|
||||
onClick={() => setApproved(true)}
|
||||
className="bg-foreground px-5 py-3 font-mono text-[12px] uppercase tracking-[0.1em] text-background transition-colors hover:bg-[var(--accent-red)]"
|
||||
>
|
||||
Godkänn & frigör 50 %
|
||||
Godkänn · frigör 50 %
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user