From 8fa53668ee703ab16f882b69b7afb7111fc75874 Mon Sep 17 00:00:00 2001 From: rajun Date: Tue, 27 Oct 2026 16:28:48 +0530 Subject: [PATCH] feat: add project types --- app/types/project.ts | 76 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 app/types/project.ts diff --git a/app/types/project.ts b/app/types/project.ts new file mode 100644 index 0000000..db842c6 --- /dev/null +++ b/app/types/project.ts @@ -0,0 +1,76 @@ +import type { RecordModel } from 'pocketbase'; + +export type LogoBackground = 'light' | 'dark'; +export type ProjectStatus = 'active' | 'archived'; + +export interface Project extends RecordModel { + name: string; + logo: string; + logo_bg: LogoBackground; + logo_bg_color: string; + brand_color: string; + button_text_color: string; + button_label: string; + // AR page options; missing keys fall back to AR_PAGE_DEFAULTS + ar_page: Partial | null; + description: string; + status: ProjectStatus; + created: string; + updated: string; +} + +export interface ColorPreset { + value: string; + label: string; +} + +export interface ProjectSummary extends Project { + assetCount: number; +} + +// What a client logo needs to render, whether it comes from a saved project or an unsaved form +export interface BrandIdentity { + name: string; + logoUrl?: string; + // Light/dark decides contrast (fallback text colour); a custom colour, when set, is painted behind the logo + logoBg: LogoBackground; + logoBgColor?: string; +} + +export type ButtonSize = 'sm' | 'md' | 'lg' | 'full' | 'custom'; + +// Exact button measurements (px) for the "custom" size +export interface ButtonCustomSize { + height: number; + // Empty fits the label + width: number | null; + paddingX: number; + radius: number; + borderWidth: number; + borderColor: string; +} + +// The AR page's "View in your space" button; anything unset falls back to thob's default +export interface ButtonStyle { + color?: string; + textColor?: string; + label?: string; + size?: ButtonSize; + custom?: ButtonCustomSize; +} + +// What the AR page shows around the model +export interface ArPageLayout { + // Top and bottom bars; off lets the model fill the screen, with the logo and button over it + bars: boolean; + modelName: boolean; + // The rounded backing behind the client logo + logoBacking: boolean; + thobLogo: boolean; +} + +// Stored in projects.ar_page +export interface ArPageSettings extends ArPageLayout { + buttonSize: ButtonSize; + buttonCustom: ButtonCustomSize; +}