2022-06-07 08:49:12 +02:00
|
|
|
import { z } from 'zod'
|
2022-06-11 07:27:38 +02:00
|
|
|
import { blockBaseSchema, BubbleBlockType } from '../shared'
|
2022-06-07 08:49:12 +02:00
|
|
|
|
|
|
|
export const imageBubbleContentSchema = z.object({
|
|
|
|
url: z.string().optional(),
|
|
|
|
})
|
|
|
|
|
2022-06-11 07:27:38 +02:00
|
|
|
export const imageBubbleBlockSchema = blockBaseSchema.and(
|
2022-06-07 08:49:12 +02:00
|
|
|
z.object({
|
2022-06-11 07:27:38 +02:00
|
|
|
type: z.enum([BubbleBlockType.IMAGE]),
|
2022-06-07 08:49:12 +02:00
|
|
|
content: imageBubbleContentSchema,
|
|
|
|
})
|
|
|
|
)
|
|
|
|
|
|
|
|
export const defaultImageBubbleContent: ImageBubbleContent = {}
|
|
|
|
|
2022-06-11 07:27:38 +02:00
|
|
|
export type ImageBubbleBlock = z.infer<typeof imageBubbleBlockSchema>
|
2022-06-07 08:49:12 +02:00
|
|
|
export type ImageBubbleContent = z.infer<typeof imageBubbleContentSchema>
|