chore(admin): split options enum dans fichier neutre

Le client component CarbetForm importait des options depuis lib/admin/carbets
qui contient "server-only" → erreur build turbopack. Sortie des options dans
src/lib/admin/carbet-options.ts sans server-only.
This commit is contained in:
Claude Integration 2026-05-31 21:06:47 +00:00
parent 820f7a821b
commit fc01144e0e
2 changed files with 24 additions and 1 deletions

View file

@ -6,7 +6,7 @@ import {
ACCESS_TYPE_OPTIONS,
STATUS_OPTIONS,
TRANSPORT_MODE_OPTIONS,
} from "@/lib/admin/carbets";
} from "@/lib/admin/carbet-options";
export type CarbetFormInitial = {
ownerId?: string;

View file

@ -0,0 +1,23 @@
/**
* Options enum pour les selects du formulaire Carbet fichier neutre
* (pas server-only, importable depuis les composants client).
*/
import { AccessType, CarbetStatus, TransportMode } from "@/generated/prisma/enums";
export const ACCESS_TYPE_OPTIONS: { value: AccessType; label: string }[] = [
{ value: AccessType.ROAD_AND_RIVER, label: "🛣️ Route + fleuve" },
{ value: AccessType.RIVER_ONLY, label: "🛶 Expédition fleuve" },
];
export const TRANSPORT_MODE_OPTIONS: { value: TransportMode; label: string }[] = [
{ value: TransportMode.SELF_ARRANGE, label: "🗺️ À organiser par le voyageur" },
{ value: TransportMode.OWNER_PROVIDES, label: "👤 Le loueur fournit" },
{ value: TransportMode.PARTNER_PROVIDER, label: "🤝 Partenaire référencé" },
];
export const STATUS_OPTIONS: { value: CarbetStatus; label: string }[] = [
{ value: CarbetStatus.DRAFT, label: "Brouillon" },
{ value: CarbetStatus.PUBLISHED, label: "Publié" },
{ value: CarbetStatus.ARCHIVED, label: "Archivé" },
];