Supabase-Clients (Browser/Server/Admin), Session-Proxy und Basis-Typen
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
export type Role = "admin" | "staff";
|
||||
|
||||
export interface Profile {
|
||||
id: string;
|
||||
email: string;
|
||||
full_name: string;
|
||||
role: Role;
|
||||
created_at: string;
|
||||
}
|
||||
|
||||
export interface Section {
|
||||
key: string;
|
||||
label: string;
|
||||
time_range: string;
|
||||
sort: number;
|
||||
}
|
||||
|
||||
export interface Dish {
|
||||
id: string;
|
||||
name: string;
|
||||
price: number;
|
||||
}
|
||||
|
||||
export interface MenuEntry {
|
||||
id: string;
|
||||
menu_date: string;
|
||||
section_key: string;
|
||||
position: number;
|
||||
dish: Dish;
|
||||
}
|
||||
|
||||
export interface CodeItem {
|
||||
code: string;
|
||||
name: string;
|
||||
sort: number;
|
||||
}
|
||||
|
||||
// Farb-Defaults (r-hofmann.de: Blau #003388, Navy #0d315c, Orange #ff6900)
|
||||
export const DEFAULT_COLORS: Record<string, string> = {
|
||||
primary: "#003388",
|
||||
primaryDark: "#0d315c",
|
||||
accent: "#ff6900",
|
||||
headerText: "#ffffff",
|
||||
rowBg: "#e3e4f1",
|
||||
rowBgAlt: "#f4f4fa",
|
||||
addBtn: "#6da54c",
|
||||
deleteBtn: "#e2371d",
|
||||
};
|
||||
|
||||
export const COLOR_VARS: Record<string, string> = {
|
||||
primary: "--c-primary",
|
||||
primaryDark: "--c-primary-dark",
|
||||
accent: "--c-accent",
|
||||
headerText: "--c-header-text",
|
||||
rowBg: "--c-row-bg",
|
||||
rowBgAlt: "--c-row-bg-alt",
|
||||
addBtn: "--c-add",
|
||||
deleteBtn: "--c-del",
|
||||
};
|
||||
|
||||
export const COLOR_LABELS: Record<string, string> = {
|
||||
primary: "Primärfarbe (Tabellenkopf)",
|
||||
primaryDark: "Primärfarbe dunkel (Kopfleiste intern)",
|
||||
accent: "Akzentfarbe",
|
||||
headerText: "Schriftfarbe im Tabellenkopf",
|
||||
rowBg: "Zellen-Hintergrund",
|
||||
rowBgAlt: "Zellen-Hintergrund (alternierend)",
|
||||
addBtn: "Button „Hinzufügen“",
|
||||
deleteBtn: "Button „Löschen“",
|
||||
};
|
||||
|
||||
export function logoUrl(path: string | null | undefined): string | null {
|
||||
if (!path) return null;
|
||||
return `${process.env.NEXT_PUBLIC_SUPABASE_URL}/storage/v1/object/public/branding/${path}`;
|
||||
}
|
||||
Reference in New Issue
Block a user