Files
CoHaiSe/frontend/web/app/components/Services.tsx
T
Esiah 09cf07d79b feat: migrate showcase to Next.js and overhaul CRM UI
- rebuild the public site on the Next.js App Router with static export,
  per-section SEO pages, metadata, sitemap, robots and a generated OG image
- add full-screen scroll-snap regions, staged scroll reveals, a hash-free
  tab navigation with a sliding indicator and region-by-region menu scrolling
- replace the theme text toggle with animated sun/moon icons
- restructure the CRM API into config, middleware, models, routes, services
  and utils layers
- redesign the CRM shell with a single surface, tab rail, full-width blurred
  DataTable, record dialogs and mask-based icons
- update Docker/Nginx publishing, Makefile targets, shared UI polish and docs
2026-11-16 00:52:29 +01:00

102 lines
3.6 KiB
TypeScript

"use client";
import { useState } from "react";
import { cn } from "@cohaise/ui";
import { useLanguage } from "../contexts/LanguageContext";
import type { Service } from "../data/services";
import { Section, SectionHeading } from "./Section";
/**
* Services en onglets plutôt qu'en accordéon : la hauteur de la région reste
* stable, donc le scroll-snap ne saute jamais quand on change de service.
*/
export const Services = ({ services }: { services: Service[] }) => {
const { t, pick } = useLanguage();
const [selected, setSelected] = useState(services[0]?.slug ?? null);
const current =
services.find((service) => service.slug === selected) ?? services[0];
return (
<Section id="services">
<SectionHeading
title={t("services.title")}
subtitle={t("services.subtitle")}
/>
<div className="grid gap-6 md:grid-cols-[minmax(0,0.85fr)_minmax(0,1.15fr)] md:items-center md:gap-10">
<div className="flex flex-col" data-reveal>
{services.map((service) => {
const active = service.slug === current?.slug;
return (
<button
key={service.slug}
type="button"
onClick={() => setSelected(service.slug)}
aria-pressed={active}
className={cn(
"group flex w-full items-center gap-3 border-b border-border/60 py-3 text-left first:border-t sm:py-4",
active
? "text-foreground"
: "text-muted-foreground hover:text-foreground",
)}
>
<span
className={cn(
"font-display text-xl font-bold uppercase tracking-display transition-colors sm:text-2xl md:text-3xl",
active && "text-accent",
)}
>
{pick(service.title)}
</span>
<span
aria-hidden="true"
className={cn(
"ml-auto font-display text-2xl font-light transition-transform duration-base",
active
? "rotate-45 text-accent"
: "rotate-0 text-subtle-foreground",
)}
>
+
</span>
</button>
);
})}
</div>
{current ? (
<div
data-reveal
data-reveal-delay="0.12"
aria-live="polite"
className="glass flex min-h-40 flex-col gap-4 rounded-lg border border-border/60 p-4 sm:min-h-72 sm:p-5"
>
<img
src={current.image}
alt=""
width={600}
height={400}
loading="lazy"
decoding="async"
className="hidden aspect-[16/9] max-h-48 w-full rounded-md border border-border/60 object-cover sm:block"
/>
<p className="text-sm leading-relaxed text-muted-foreground sm:text-base">
{pick(current.description)}
</p>
<ul className="flex flex-wrap gap-2">
{current.tags.map((tag) => (
<li
key={pick(tag)}
className="rounded-full border border-border/60 px-3 py-1 text-[0.625rem] uppercase tracking-label text-foreground transition-colors hover:bg-surface-hover sm:px-4 sm:py-1.5 sm:text-[0.6875rem]"
>
{pick(tag)}
</li>
))}
</ul>
</div>
) : null}
</div>
</Section>
);
};