import { z } from 'zod'; export const profileSchema = z.object({ username: z .string() .min(3, { message: 'Username must be at least 3 characters' }) .max(20, { message: 'Username is too long' }) .regex(/^[a-zA-Z0-9_]+$/, { message: 'Only letters, numbers, and underscores allowed' }), bio: z.string().max(160, { message: 'Bio must be under 160 characters' }).optional().default(''), }); // Automatically generate a TS type from the Zod schema export type ProfileSchema = z.infer;