2
0
Files
bot/packages/models/src/features/blocks/bubbles/embed.ts

20 lines
577 B
TypeScript
Raw Normal View History

2022-06-11 07:27:38 +02:00
import { blockBaseSchema, BubbleBlockType } from '../shared'
import { z } from 'zod'
export const embedBubbleContentSchema = z.object({
url: z.string().optional(),
height: z.number(),
})
2022-06-11 07:27:38 +02:00
export const embedBubbleBlockSchema = blockBaseSchema.and(
z.object({
2022-06-11 07:27:38 +02:00
type: z.enum([BubbleBlockType.EMBED]),
content: embedBubbleContentSchema,
})
)
export const defaultEmbedBubbleContent: EmbedBubbleContent = { height: 400 }
2022-06-11 07:27:38 +02:00
export type EmbedBubbleBlock = z.infer<typeof embedBubbleBlockSchema>
export type EmbedBubbleContent = z.infer<typeof embedBubbleContentSchema>