Support adding existing documents to a session

This commit is contained in:
2025-10-11 18:06:22 -07:00
parent d1432d048f
commit 907df26395
10 changed files with 216 additions and 111 deletions

View File

@@ -1,8 +1,9 @@
import { type DocumentData, type DocumentType } from "./types";
export type FieldType = "shortText" | "longText" | "toggle";
export type FieldType = "identifier" | "shortText" | "longText" | "toggle";
export type ValueForFieldType<F extends FieldType> = {
identifier: string;
shortText: string;
longText: string;
toggle: boolean;
@@ -10,6 +11,7 @@ export type ValueForFieldType<F extends FieldType> = {
function defaultValue<F extends FieldType>(fieldType: F): ValueForFieldType<F> {
switch (fieldType) {
case "identifier":
case "shortText":
case "longText":
return "" as ValueForFieldType<F>;