|
| 1 | +"use client"; |
| 2 | + |
| 3 | +import Link from "next/link"; |
| 4 | +import { ChevronLeft } from "lucide-react"; |
| 5 | +import { useMemo, useState } from "react"; |
| 6 | +import { type Subprocessor, subprocessors } from "./trust-content"; |
| 7 | + |
| 8 | +import { SiteFooter } from "./site-footer"; |
| 9 | + |
| 10 | +import { LandingBackground } from "./landing-background"; |
| 11 | +import { SiteNav } from "./site-nav"; |
| 12 | +import { |
| 13 | + defaultTrustTopicSlug, |
| 14 | + getTrustTopic, |
| 15 | + statusPageRequestHref, |
| 16 | + trustTopics, |
| 17 | + type TrustTopic |
| 18 | +} from "./trust-content"; |
| 19 | + |
| 20 | +const categoryColors: Record<string, string> = { |
| 21 | + Analytics: "bg-orange-50 text-orange-700", |
| 22 | + Payments: "bg-violet-50 text-violet-700", |
| 23 | + Authentication: "bg-blue-50 text-blue-700", |
| 24 | + Infrastructure: "bg-cyan-50 text-cyan-700" |
| 25 | +}; |
| 26 | + |
| 27 | +function SubprocessorRows() { |
| 28 | + return ( |
| 29 | + <div className="mt-5 flex flex-col divide-y divide-slate-200/70 overflow-hidden rounded-2xl border border-slate-200/70 bg-white/85"> |
| 30 | + {subprocessors.map((sp) => ( |
| 31 | + <a |
| 32 | + key={sp.name} |
| 33 | + href={sp.href} |
| 34 | + rel="noreferrer" |
| 35 | + target="_blank" |
| 36 | + className="flex min-w-0 items-center gap-3 px-4 py-2.5 transition-colors hover:bg-slate-50/80" |
| 37 | + > |
| 38 | + <div |
| 39 | + className="flex h-8 w-8 shrink-0 items-center justify-center rounded-lg text-[10px] font-bold tracking-wide" |
| 40 | + style={{ backgroundColor: sp.brandColor, color: sp.textColor }} |
| 41 | + > |
| 42 | + {sp.initial} |
| 43 | + </div> |
| 44 | + <div className="min-w-0 flex-1"> |
| 45 | + <p className="truncate text-[13px] leading-relaxed text-slate-500"> |
| 46 | + <span className="font-semibold text-[#011627]">{sp.name}</span> |
| 47 | + {": "} |
| 48 | + {sp.purpose} |
| 49 | + </p> |
| 50 | + </div> |
| 51 | + <div className="hidden shrink-0 items-center gap-2 sm:flex"> |
| 52 | + <span |
| 53 | + className={`rounded-full px-2 py-0.5 text-[11px] font-medium ${categoryColors[sp.category] ?? "bg-slate-100 text-slate-600"}`} |
| 54 | + > |
| 55 | + {sp.category} |
| 56 | + </span> |
| 57 | + <span className="text-[11px] text-slate-400">{sp.location} Region</span> |
| 58 | + </div> |
| 59 | + </a> |
| 60 | + ))} |
| 61 | + </div> |
| 62 | + ); |
| 63 | +} |
| 64 | + |
| 65 | +type SharedProps = { |
| 66 | + stars: string; |
| 67 | + downloadHref: string; |
| 68 | + calUrl: string; |
| 69 | +}; |
| 70 | + |
| 71 | +function externalLinkProps(href: string) { |
| 72 | + return /^https?:\/\//.test(href) || href.startsWith("mailto:") |
| 73 | + ? { rel: "noreferrer", target: "_blank" as const } |
| 74 | + : {}; |
| 75 | +} |
| 76 | + |
| 77 | +function TopicChip({ |
| 78 | + topic, |
| 79 | + active, |
| 80 | + onSelect |
| 81 | +}: { |
| 82 | + topic: TrustTopic; |
| 83 | + active: boolean; |
| 84 | + onSelect: (slug: string) => void; |
| 85 | +}) { |
| 86 | + return ( |
| 87 | + <button |
| 88 | + type="button" |
| 89 | + onClick={() => onSelect(topic.slug)} |
| 90 | + className={`shrink-0 rounded-full border px-3.5 py-1.5 text-[13px] font-medium tracking-tight transition-all ${ |
| 91 | + active |
| 92 | + ? "border-[#011627] bg-[#011627] text-white shadow-[0_8px_20px_-8px_rgba(1,22,39,0.45)]" |
| 93 | + : "border-slate-200/80 bg-white/80 text-slate-600 hover:border-slate-300 hover:text-[#011627]" |
| 94 | + }`} |
| 95 | + aria-pressed={active} |
| 96 | + > |
| 97 | + {topic.label} |
| 98 | + </button> |
| 99 | + ); |
| 100 | +} |
| 101 | + |
| 102 | +function TopicRailItem({ |
| 103 | + topic, |
| 104 | + active, |
| 105 | + onSelect |
| 106 | +}: { |
| 107 | + topic: TrustTopic; |
| 108 | + active: boolean; |
| 109 | + onSelect: (slug: string) => void; |
| 110 | +}) { |
| 111 | + return ( |
| 112 | + <button |
| 113 | + type="button" |
| 114 | + onClick={() => onSelect(topic.slug)} |
| 115 | + className={`w-full rounded-[1.2rem] border px-4 py-3 text-left transition-all ${ |
| 116 | + active |
| 117 | + ? "border-[#011627] bg-[#011627] text-white shadow-[0_14px_32px_-18px_rgba(1,22,39,0.55)]" |
| 118 | + : "border-slate-200/80 bg-white/80 text-slate-600 hover:border-slate-300 hover:text-[#011627]" |
| 119 | + }`} |
| 120 | + aria-pressed={active} |
| 121 | + > |
| 122 | + <div className="text-[14px] font-medium tracking-tight">{topic.label}</div> |
| 123 | + </button> |
| 124 | + ); |
| 125 | +} |
| 126 | + |
| 127 | +function TopicPanel({ topic, callHref }: { topic: TrustTopic; callHref: string }) { |
| 128 | + const Icon = topic.icon; |
| 129 | + |
| 130 | + return ( |
| 131 | + <div className="landing-shell flex h-full flex-col rounded-[1.75rem] p-5 md:p-6"> |
| 132 | + <div> |
| 133 | + <div className="flex items-center gap-3"> |
| 134 | + <div |
| 135 | + className={`flex h-9 w-9 shrink-0 items-center justify-center rounded-xl ${topic.toneClassName}`} |
| 136 | + > |
| 137 | + <Icon size={16} /> |
| 138 | + </div> |
| 139 | + <h2 className="max-w-2xl text-[1.2rem] font-medium tracking-tight text-[#011627] md:text-[1.35rem]"> |
| 140 | + {topic.title} |
| 141 | + </h2> |
| 142 | + </div> |
| 143 | + <p className="mt-2 max-w-2xl text-[13px] leading-relaxed text-slate-600 md:text-[14px]"> |
| 144 | + {topic.panelIntro} |
| 145 | + </p> |
| 146 | + </div> |
| 147 | + |
| 148 | + {topic.slug === "subprocessors" ? ( |
| 149 | + <SubprocessorRows /> |
| 150 | + ) : ( |
| 151 | + <div className="mt-3 flex flex-1 flex-col gap-2"> |
| 152 | + {topic.bullets.map((bullet) => ( |
| 153 | + <div |
| 154 | + key={bullet} |
| 155 | + className="flex flex-1 items-center rounded-2xl border border-slate-200/70 bg-white/85 px-4 py-2 text-[13px] leading-relaxed text-slate-600" |
| 156 | + > |
| 157 | + {bullet} |
| 158 | + </div> |
| 159 | + ))} |
| 160 | + </div> |
| 161 | + )} |
| 162 | + |
| 163 | + <div className="mt-3 flex flex-col items-start gap-3 sm:flex-row sm:items-center"> |
| 164 | + {topic.slug === "status-page-access" ? ( |
| 165 | + <a |
| 166 | + href={statusPageRequestHref} |
| 167 | + className="doc-button text-sm" |
| 168 | + {...externalLinkProps(statusPageRequestHref)} |
| 169 | + > |
| 170 | + Request status page |
| 171 | + </a> |
| 172 | + ) : topic.slug === "subprocessors" ? null : ( |
| 173 | + <a href={callHref} className="doc-button text-sm" {...externalLinkProps(callHref)}> |
| 174 | + Book a call |
| 175 | + </a> |
| 176 | + )} |
| 177 | + </div> |
| 178 | + </div> |
| 179 | + ); |
| 180 | +} |
| 181 | + |
| 182 | +export function LandingTrustOverview(props: SharedProps) { |
| 183 | + const callHref = props.calUrl || "/enterprise#book"; |
| 184 | + const [activeSlug, setActiveSlug] = useState(defaultTrustTopicSlug); |
| 185 | + |
| 186 | + const activeTopic = useMemo( |
| 187 | + () => getTrustTopic(activeSlug) ?? trustTopics[0], |
| 188 | + [activeSlug] |
| 189 | + ); |
| 190 | + |
| 191 | + return ( |
| 192 | + <div className="relative min-h-screen overflow-hidden text-[#011627]"> |
| 193 | + <LandingBackground /> |
| 194 | + |
| 195 | + <div className="relative z-10 flex min-h-screen flex-col items-center pb-3 pt-1 md:pb-4 md:pt-2"> |
| 196 | + <div className="w-full"> |
| 197 | + <SiteNav |
| 198 | + stars={props.stars} |
| 199 | + callUrl={callHref} |
| 200 | + downloadHref={props.downloadHref} |
| 201 | + /> |
| 202 | + </div> |
| 203 | + |
| 204 | + <main className="mx-auto flex min-h-[calc(100vh-6rem)] w-full max-w-5xl flex-1 flex-col justify-between gap-4 px-6 pb-6 md:px-8 md:pb-8"> |
| 205 | + <section className="max-w-4xl pt-2 md:pt-3"> |
| 206 | + <h1 className="max-w-4xl text-4xl font-medium leading-[1.05] tracking-tight md:text-[2.7rem] lg:text-[3rem]"> |
| 207 | + Openwork's Trust Center |
| 208 | + </h1> |
| 209 | + |
| 210 | + <p className="mt-3 max-w-4xl text-[15px] leading-relaxed text-slate-600 md:text-[16px]"> |
| 211 | + Moving at startup speed without compromising on enterprise protection. |
| 212 | + We treat security not as an afterthought, but as a foundational pillar of everything we build. |
| 213 | + This mindset drives our development processes, infrastructure decisions, and organizational policies. |
| 214 | + We treat the data entrusted to us with the utmost care and responsibility. |
| 215 | + </p> |
| 216 | + </section> |
| 217 | + |
| 218 | + <section className="flex flex-col gap-4 xl:grid xl:grid-cols-[220px_minmax(0,1fr)]"> |
| 219 | + {/* Mobile: horizontal scrollable chip row */} |
| 220 | + <div className="flex gap-2 overflow-x-auto pb-1 [&::-webkit-scrollbar]:hidden xl:hidden"> |
| 221 | + {trustTopics.map((topic) => ( |
| 222 | + <TopicChip |
| 223 | + key={topic.slug} |
| 224 | + topic={topic} |
| 225 | + active={topic.slug === activeTopic.slug} |
| 226 | + onSelect={setActiveSlug} |
| 227 | + /> |
| 228 | + ))} |
| 229 | + </div> |
| 230 | + |
| 231 | + {/* Desktop: sidebar rail */} |
| 232 | + <div className="landing-shell hidden rounded-[1.75rem] p-5 xl:block"> |
| 233 | + <div className="mb-3 text-[11px] font-semibold uppercase tracking-[0.18em] text-slate-500"> |
| 234 | + Topics |
| 235 | + </div> |
| 236 | + <div className="grid gap-2"> |
| 237 | + {trustTopics.map((topic) => ( |
| 238 | + <TopicRailItem |
| 239 | + key={topic.slug} |
| 240 | + topic={topic} |
| 241 | + active={topic.slug === activeTopic.slug} |
| 242 | + onSelect={setActiveSlug} |
| 243 | + /> |
| 244 | + ))} |
| 245 | + </div> |
| 246 | + </div> |
| 247 | + |
| 248 | + <TopicPanel topic={activeTopic} callHref={callHref} /> |
| 249 | + </section> |
| 250 | + |
| 251 | + <SiteFooter /> |
| 252 | + |
| 253 | + </main> |
| 254 | + </div> |
| 255 | + </div> |
| 256 | + ); |
| 257 | +} |
0 commit comments