2022-06-07 08:49:12 +02:00
|
|
|
import { z } from 'zod'
|
2023-01-25 11:27:47 +01:00
|
|
|
import { blockBaseSchema } from '../../baseSchemas'
|
|
|
|
import { BubbleBlockType } from '../enums'
|
|
|
|
import { VideoBubbleContentType } from './enums'
|
2022-06-07 08:49:12 +02:00
|
|
|
|
|
|
|
export const videoBubbleContentSchema = z.object({
|
|
|
|
url: z.string().optional(),
|
|
|
|
id: z.string().optional(),
|
|
|
|
type: z.nativeEnum(VideoBubbleContentType).optional(),
|
|
|
|
})
|
|
|
|
|
2022-06-11 07:27:38 +02:00
|
|
|
export const videoBubbleBlockSchema = blockBaseSchema.and(
|
2022-06-07 08:49:12 +02:00
|
|
|
z.object({
|
2022-06-11 07:27:38 +02:00
|
|
|
type: z.enum([BubbleBlockType.VIDEO]),
|
2022-06-07 08:49:12 +02:00
|
|
|
content: videoBubbleContentSchema,
|
|
|
|
})
|
|
|
|
)
|
|
|
|
|
|
|
|
export const defaultVideoBubbleContent: VideoBubbleContent = {}
|
|
|
|
|
2022-06-11 07:27:38 +02:00
|
|
|
export type VideoBubbleBlock = z.infer<typeof videoBubbleBlockSchema>
|
2022-06-07 08:49:12 +02:00
|
|
|
export type VideoBubbleContent = z.infer<typeof videoBubbleContentSchema>
|