Added world creation dialog

This commit is contained in:
Alexis
2024-09-09 22:09:59 +02:00
parent f6898da2f2
commit c19262e3c2
12 changed files with 403 additions and 62 deletions

View File

@@ -1 +1,7 @@
export type RPGColor = "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia" | "pink" | "rose" | "black" | "white"
import { z } from "zod"
export const rpgColors = ["red", "orange", "amber", "yellow", "lime", "green", "emerald", "teal", "cyan", "sky", "blue", "indigo", "violet", "purple", "fuchsia", "pink", "rose", "black", "white"] as const
export type RPGColor = typeof rpgColors[number];
export const rpgColorSchema = z.enum(rpgColors)

View File

@@ -1,10 +1,19 @@
import { z } from "zod"
import type { Calendar } from "./CalendarConfig"
import { rpgColorSchema, type RPGColor } from "./Color"
export interface World {
id: number
uuid: string
id?: number
name: string
description?: string
color?: string,
calendars?: Calendar[]
color?: RPGColor,
calendars?: Calendar[],
gmId?: string
}
export const postWorldSchema = z.object({
name: z.string(),
description: z.string().optional().nullable(),
color: rpgColorSchema,
gmId: z.string().optional().nullable(),
})