// Shared enum values + types. NO server/ORM imports here — this file is safe to // import from client components (replaces the old `@prisma/client` enum imports). // // Defined as `const object + union type` (the same shape Prisma generated) rather // than a TS `enum`, so bare string literals like "IMAGE" stay assignable and // `z.nativeEnum(...)` keeps working. export const PortfolioSectionType = { RICH_TEXT: "RICH_TEXT", GALLERY: "GALLERY", STATS: "STATS", DELIVERABLES: "DELIVERABLES", LINK: "LINK", } as const; export type PortfolioSectionType = (typeof PortfolioSectionType)[keyof typeof PortfolioSectionType]; export const PortfolioAssetKind = { IMAGE: "IMAGE", DOCUMENT: "DOCUMENT", } as const; export type PortfolioAssetKind = (typeof PortfolioAssetKind)[keyof typeof PortfolioAssetKind]; export const PortfolioProjectViewMode = { GRID: "GRID", STORY: "STORY", CASE_STUDY: "CASE_STUDY", } as const; export type PortfolioProjectViewMode = (typeof PortfolioProjectViewMode)[keyof typeof PortfolioProjectViewMode]; export const MediaSource = { UPLOAD: "UPLOAD", EXTERNAL: "EXTERNAL", } as const; export type MediaSource = (typeof MediaSource)[keyof typeof MediaSource]; export const MediaKind = { IMAGE: "IMAGE", DOCUMENT: "DOCUMENT", } as const; export type MediaKind = (typeof MediaKind)[keyof typeof MediaKind]; export const MediaUsageType = { PORTFOLIO_COVER: "PORTFOLIO_COVER", PORTFOLIO_SECTION: "PORTFOLIO_SECTION", PORTFOLIO_ASSET: "PORTFOLIO_ASSET", GENERIC: "GENERIC", } as const; export type MediaUsageType = (typeof MediaUsageType)[keyof typeof MediaUsageType]; // Helper: enum-object -> tuple of its string values, for Drizzle pgEnum(...). // Preserves the literal union (not widened to `string`) so pgEnum columns infer // as the exact union type. export function enumValues>(e: T): [T[keyof T], ...T[keyof T][]] { return Object.values(e) as [T[keyof T], ...T[keyof T][]]; }