import { z } from "zod";
export const categories = [
"urgent",
"newsletter",
"work",
"personal",
"unknown",
] as const;
export const emailCategorySchema = z.enum(categories);
export type EmailCategory = z.infer<typeof emailCategorySchema>;
export const emailSchema = z.object({
id: z.string(),
threadId: z.string(),
snippet: z.string(),
from: z.string(),
to: z.string(),
subject: z.string(),
date: z.string(),
category: emailCategorySchema,
});
export const emailListSchema = z.array(emailSchema);
export type Email = z.infer<typeof emailSchema>;