2
0
Files
bot/packages/schemas/features/blocks/bubbles/image/schema.ts
Baptiste Arnaud 35300eaf34 ♻️ Introduce typebot v6 with events (#1013)
Closes #885
2023-11-08 15:34:16 +01:00

23 lines
570 B
TypeScript

import { z } from 'zod'
import { BubbleBlockType } from '../constants'
import { blockBaseSchema } from '../../shared'
export const imageBubbleContentSchema = z.object({
url: z.string().optional(),
clickLink: z
.object({
url: z.string().optional(),
alt: z.string().optional(),
})
.optional(),
})
export const imageBubbleBlockSchema = blockBaseSchema.merge(
z.object({
type: z.enum([BubbleBlockType.IMAGE]),
content: imageBubbleContentSchema.optional(),
})
)
export type ImageBubbleBlock = z.infer<typeof imageBubbleBlockSchema>