Files
HiveGrid-Wireframes/03 Quellen und Referenzen/hivegrid-website/components/sections/WorkflowShowcase.tsx
T

322 lines
15 KiB
TypeScript

"use client";
/* ─── SVG Node Icons ──────────────────────────────────────────────────── */
function IconInbox({ color = "currentColor", size = 20 }: { color?: string; size?: number }) {
return (
<svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
<polyline points="22 12 16 12 14 15 10 15 8 12 2 12" />
<path d="M5.45 5.11L2 12v6a2 2 0 002 2h16a2 2 0 002-2v-6l-3.45-6.89A2 2 0 0016.76 4H7.24a2 2 0 00-1.79 1.11z" />
</svg>
);
}
function IconClipboard({ color = "currentColor", size = 20 }: { color?: string; size?: number }) {
return (
<svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
<path d="M16 4h2a2 2 0 012 2v14a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2h2" />
<rect x="8" y="2" width="8" height="4" rx="1" ry="1" />
</svg>
);
}
function IconUser({ color = "currentColor", size = 20 }: { color?: string; size?: number }) {
return (
<svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
<path d="M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2" />
<circle cx="12" cy="7" r="4" />
</svg>
);
}
function IconPackage({ color = "currentColor", size = 20 }: { color?: string; size?: number }) {
return (
<svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
<path d="M16.5 9.4l-9-5.19M21 16V8a2 2 0 00-1-1.73l-7-4a2 2 0 00-2 0l-7 4A2 2 0 003 8v8a2 2 0 001 1.73l7 4a2 2 0 002 0l7-4A2 2 0 0021 16z" />
<polyline points="3.27 6.96 12 12.01 20.73 6.96" />
<line x1="12" y1="22.08" x2="12" y2="12" />
</svg>
);
}
function IconCalendar({ color = "currentColor", size = 20 }: { color?: string; size?: number }) {
return (
<svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
<rect x="3" y="4" width="18" height="18" rx="2" ry="2" />
<line x1="16" y1="2" x2="16" y2="6" />
<line x1="8" y1="2" x2="8" y2="6" />
<line x1="3" y1="10" x2="21" y2="10" />
</svg>
);
}
function IconCheckCircle({ color = "currentColor", size = 20 }: { color?: string; size?: number }) {
return (
<svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
<path d="M22 11.08V12a10 10 0 11-5.93-9.14" />
<polyline points="22 4 12 14.01 9 11.01" />
</svg>
);
}
function IconReceipt({ color = "currentColor", size = 20 }: { color?: string; size?: number }) {
return (
<svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
<path d="M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1z" />
<path d="M8 10h8" />
<path d="M8 14h4" />
</svg>
);
}
/* ─── Data ────────────────────────────────────────────────────────────── */
const nodes = [
{ id: "inbox", title: "Anfrage eingeht", desc: "Formular, E-Mail, Telefon", color: "#4F46E5", Icon: IconInbox },
{ id: "order", title: "Auftrag erstellt", desc: "Automatisch aus Anfrage", color: "#F1B729", Icon: IconClipboard },
{ id: "assign", title: "Techniker zuweisen", desc: "Basierend auf Verfügbarkeit", color: "#0D6E6E", Icon: IconUser },
{ id: "material", title: "Material bestellen", desc: "Automatisch reserviert", color: "#F97316", Icon: IconPackage },
{ id: "schedule", title: "Einsatz geplant", desc: "Termin nach Kapazität", color: "#3B82F6", Icon: IconCalendar },
{ id: "done", title: "Arbeit erledigt", desc: "Dokumentiert via App", color: "#22C55E", Icon: IconCheckCircle },
{ id: "invoice", title: "Rechnung versendet", desc: "Automatisch per Mail", color: "#8B5CF6", Icon: IconReceipt },
];
/* ─── Arrow between nodes ─────────────────────────────────────────────── */
function Arrow() {
return (
<div className="hidden lg:flex items-center justify-center shrink-0" style={{ width: 32 }}>
<svg width="32" height="16" viewBox="0 0 32 16" fill="none">
<path d="M0 8h24" stroke="var(--border-neutral)" strokeWidth="1.5" />
<path d="M22 4l6 4-6 4" stroke="var(--border-neutral)" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" />
</svg>
</div>
);
}
function ArrowDown() {
return (
<div className="flex items-center justify-center" style={{ height: 28 }}>
<svg width="16" height="28" viewBox="0 0 16 28" fill="none">
<path d="M8 0v20" stroke="var(--border-neutral)" strokeWidth="1.5" />
<path d="M4 18l4 6 4-6" stroke="var(--border-neutral)" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" />
</svg>
</div>
);
}
/* ─── Variant 1: Horizontal Pipeline (n8n style) ─────────────────────── */
function WorkflowVariant1() {
return (
<div className="rounded-2xl" style={{ border: "1px solid var(--border-light)", background: "var(--container-bg)", padding: 32 }}>
<p className="text-[13px] font-semibold mb-6" style={{ color: "var(--text-muted)" }}>Variante 1 — Horizontal Pipeline (n8n-Stil)</p>
<div className="overflow-x-auto">
<div className="flex items-center" style={{ minWidth: 1000 }}>
{nodes.map((node, i) => (
<div key={node.id} className="flex items-center">
{/* Node card */}
<div
className="flex items-center gap-3 rounded-xl shrink-0"
style={{
padding: "14px 18px",
background: "#FFFFFF",
border: `2px solid ${node.color}30`,
boxShadow: `0 2px 8px ${node.color}10, 0 1px 3px rgba(0,0,0,0.06)`,
minWidth: 120,
}}
>
{/* Icon */}
<div
className="w-10 h-10 rounded-lg flex items-center justify-center shrink-0"
style={{ background: `${node.color}14` }}
>
<node.Icon color={node.color} size={18} />
</div>
{/* Text */}
<div className="flex flex-col gap-0.5">
<span className="text-[12px] font-semibold leading-tight" style={{ color: "var(--text-primary)" }}>{node.title}</span>
<span className="text-[10px] leading-snug" style={{ color: "var(--text-secondary)" }}>{node.desc}</span>
</div>
</div>
{/* Arrow */}
{i < nodes.length - 1 && <Arrow />}
</div>
))}
</div>
</div>
</div>
);
}
/* ─── Variant 2: Vertical with connector lines ───────────────────────── */
function WorkflowVariant2() {
return (
<div className="rounded-2xl" style={{ border: "1px solid var(--border-light)", background: "var(--container-bg)", padding: 32 }}>
<p className="text-[13px] font-semibold mb-6" style={{ color: "var(--text-muted)" }}>Variante 2 — Vertikale Node-Kette</p>
<div className="flex flex-col items-center">
{nodes.map((node, i) => (
<div key={node.id} className="flex flex-col items-center">
<div
className="flex items-center gap-4 rounded-xl w-full max-w-[420px]"
style={{
padding: "16px 20px",
background: "#FFFFFF",
border: `2px solid ${node.color}25`,
boxShadow: `0 2px 8px ${node.color}08, 0 1px 3px rgba(0,0,0,0.04)`,
}}
>
{/* Step number */}
<div
className="w-9 h-9 rounded-full flex items-center justify-center shrink-0 text-[12px] font-bold text-white"
style={{ background: node.color }}
>
{i + 1}
</div>
{/* Icon */}
<div className="w-10 h-10 rounded-lg flex items-center justify-center shrink-0" style={{ background: `${node.color}12` }}>
<node.Icon color={node.color} size={18} />
</div>
{/* Text */}
<div className="flex flex-col gap-0.5">
<span className="text-[14px] font-semibold leading-tight" style={{ color: "var(--text-primary)" }}>{node.title}</span>
<span className="text-[11px] leading-snug" style={{ color: "var(--text-secondary)" }}>{node.desc}</span>
</div>
</div>
{i < nodes.length - 1 && <ArrowDown />}
</div>
))}
</div>
</div>
);
}
/* ─── Variant 3: Canvas-style with zigzag ─────────────────────────────── */
function WorkflowVariant3() {
return (
<div className="rounded-2xl" style={{ border: "1px solid var(--border-light)", background: "var(--container-bg)", padding: 32 }}>
<p className="text-[13px] font-semibold mb-6" style={{ color: "var(--text-muted)" }}>Variante 3 — Canvas mit Verbindungen</p>
<div className="relative" style={{ height: 480 }}>
{/* SVG connection paths */}
<svg className="absolute inset-0 w-full h-full pointer-events-none" viewBox="0 0 1100 480" fill="none" preserveAspectRatio="xMidYMid meet">
{/* Row 1: node 0 → 1 → 2 → 3 */}
<path d="M195 70 L280 70" stroke="#D5DBE1" strokeWidth="1.5" strokeDasharray="6 3" />
<path d="M465 70 L550 70" stroke="#D5DBE1" strokeWidth="1.5" strokeDasharray="6 3" />
<path d="M735 70 L820 70" stroke="#D5DBE1" strokeWidth="1.5" strokeDasharray="6 3" />
{/* Down from node 3 to row 2 */}
<path d="M920 110 L920 170" stroke="#D5DBE1" strokeWidth="1.5" strokeDasharray="6 3" />
{/* Row 2 (reversed): node 3 → 4 → 5 → 6 */}
<path d="M820 240 L735 240" stroke="#D5DBE1" strokeWidth="1.5" strokeDasharray="6 3" />
<path d="M550 240 L465 240" stroke="#D5DBE1" strokeWidth="1.5" strokeDasharray="6 3" />
<path d="M280 240 L195 240" stroke="#D5DBE1" strokeWidth="1.5" strokeDasharray="6 3" />
{/* Arrow tips (small circles at endpoints) */}
{[280, 550, 820].map((x) => <circle key={`r1-${x}`} cx={x - 4} cy={70} r="3" fill="#D5DBE1" />)}
<circle cx={920} cy={166} r="3" fill="#D5DBE1" />
{[735, 465, 195].map((x) => <circle key={`r2-${x}`} cx={x + 4} cy={240} r="3" fill="#D5DBE1" />)}
</svg>
{/* Row 1 */}
<div className="absolute flex items-center gap-0" style={{ top: 30, left: 0 }}>
{nodes.slice(0, 4).map((node, i) => (
<div key={node.id} className="absolute" style={{ left: i * 270 }}>
<NodeCard node={node} index={i} />
</div>
))}
</div>
{/* Row 2 — reversed direction */}
<div className="absolute flex items-center" style={{ top: 200, left: 0 }}>
{nodes.slice(4).reverse().map((node, i) => {
const origIdx = nodes.indexOf(node);
return (
<div key={node.id} className="absolute" style={{ left: i * 270 }}>
<NodeCard node={node} index={origIdx} />
</div>
);
})}
</div>
</div>
</div>
);
}
function NodeCard({ node, index }: { node: typeof nodes[0]; index: number }) {
return (
<div
className="flex items-center gap-3 rounded-xl"
style={{
width: 195,
padding: "12px 14px",
background: "#FFFFFF",
border: `2px solid ${node.color}25`,
boxShadow: `0 2px 8px ${node.color}10, 0 1px 3px rgba(0,0,0,0.05)`,
}}
>
<div className="w-10 h-10 rounded-lg flex items-center justify-center shrink-0" style={{ background: `${node.color}14` }}>
<node.Icon color={node.color} size={18} />
</div>
<div className="flex flex-col gap-0.5 min-w-0">
<span className="text-[11px] font-semibold leading-tight truncate" style={{ color: "var(--text-primary)" }}>{node.title}</span>
<span className="text-[9px] leading-snug truncate" style={{ color: "var(--text-secondary)" }}>{node.desc}</span>
</div>
{/* Handle dots — n8n style */}
<div className="absolute -left-[5px] top-1/2 -translate-y-1/2 w-[10px] h-[10px] rounded-full border-2 border-white" style={{ background: node.color }} />
<div className="absolute -right-[5px] top-1/2 -translate-y-1/2 w-[10px] h-[10px] rounded-full border-2 border-white" style={{ background: node.color }} />
</div>
);
}
/* ─── Stats Bar ───────────────────────────────────────────────────────── */
function StatsBar() {
const stats = [
{ num: "7", label: "Automatisierte Schritte", color: "var(--text-primary)" },
{ num: "0", label: "Manuelle Klicks", color: "var(--accent-yellow-dark)" },
{ num: "<2 Min", label: "Durchlaufzeit", color: "var(--accent-teal)" },
{ num: "100%", label: "Dokumentiert", color: "#22C55E" },
];
return (
<div className="flex flex-wrap items-center justify-center gap-8 lg:gap-12 mt-10 pt-10" style={{ borderTop: "1px solid var(--border-light)" }}>
{stats.map((s, i) => (
<div key={s.label} className="flex items-center gap-8 lg:gap-12">
<div className="flex flex-col items-center gap-1">
<span className="text-[32px] md:text-[36px] font-bold tabular-nums" style={{ color: s.color }}>{s.num}</span>
<span className="text-[12px] font-medium" style={{ color: "var(--text-secondary)" }}>{s.label}</span>
</div>
{i < stats.length - 1 && <div className="hidden md:block" style={{ width: 1, height: 48, background: "var(--border-light)" }} />}
</div>
))}
</div>
);
}
/* ─── Main Export ─────────────────────────────────────────────────────── */
export default function WorkflowShowcase() {
return (
<section className="section-full" style={{ background: "var(--surface)", paddingBlock: 80 }}>
<div className="mx-auto" style={{ maxWidth: "var(--content-width)" }}>
<div className="flex flex-col items-center gap-4 text-center mb-16">
<span className="text-[12px] font-semibold tracking-widest chamfer-badge px-2 py-0.5" style={{ background: "var(--accent-yellow-light)", color: "var(--accent-yellow-dark)" }}>WORKFLOW</span>
<h2 className="text-[32px] md:text-[42px] font-bold leading-[1.15]" style={{ color: "var(--text-primary)" }}>Von der Anfrage bis zur Rechnung</h2>
<p className="text-[16px] leading-relaxed max-w-2xl" style={{ color: "var(--text-secondary)" }}>Drei Workflow-Visualisierungen im n8n-Stil. Jeder Node ist ein automatisierter Schritt.</p>
</div>
<div className="flex flex-col gap-8">
<WorkflowVariant1 />
<WorkflowVariant2 />
<WorkflowVariant3 />
</div>
<StatsBar />
</div>
</section>
);
}