2
0
Files
bot/packages/schemas/features/blocks/bubbles/image/schema.ts
2023-12-22 09:13:53 +01:00

23 lines
582 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>