22 lines
700 B
TypeScript
22 lines
700 B
TypeScript
import { z } from 'zod'
|
|
import { blockBaseSchema } from '../../shared'
|
|
import { VideoBubbleContentType } from './constants'
|
|
import { variableStringSchema } from '../../../utils'
|
|
import { BubbleBlockType } from '../constants'
|
|
|
|
export const videoBubbleContentSchema = z.object({
|
|
url: z.string().optional(),
|
|
id: z.string().optional(),
|
|
type: z.nativeEnum(VideoBubbleContentType).optional(),
|
|
height: z.number().or(variableStringSchema).optional(),
|
|
})
|
|
|
|
export const videoBubbleBlockSchema = blockBaseSchema.merge(
|
|
z.object({
|
|
type: z.enum([BubbleBlockType.VIDEO]),
|
|
content: videoBubbleContentSchema.optional(),
|
|
})
|
|
)
|
|
|
|
export type VideoBubbleBlock = z.infer<typeof videoBubbleBlockSchema>
|