This repository has been archived on 2024-02-08. You can view files and clone it, but cannot push or open issues or pull requests.
frontend/src/modelSchema/avatar.ts

18 lines
503 B
TypeScript

import type {TypeOf} from 'zod'
import {z, string, object} from 'zod'
export const AVATAR_PROVIDER = [
'default',
'initials',
'gravatar',
'marble',
'upload',
] as const
export const AvatarProviderSchema = z.enum(AVATAR_PROVIDER)
export type IAvatarProvider = TypeOf<typeof AvatarProviderSchema>
export const AvatarSchema = object({
// FIXME: shouldn't the default be 'default'?
avatarProvider: string().or(AvatarProviderSchema).default(''),
})
export type IAvatar = TypeOf<typeof AvatarSchema>