import type { MigrationContext } from "../types"; export function generateUiComponents(_ctx: MigrationContext): Record { const files: Record = {}; files["src/components/ui/Image.tsx"] = `export { Image as default, Image, getOptimizedMediaUrl, getSrcSet, registerImageCdnDomain, getImageCdnDomain, registerImageQuality, getImageQuality, FACTORS, type ImageProps, type FitOptions, type ImageQuality, } from "@decocms/blocks/hooks"; `; files["src/components/ui/Picture.tsx"] = `import type { ReactNode } from "react"; import { Image, getSrcSet, type FitOptions, type ImageProps, } from "@decocms/blocks/hooks"; export interface PictureSourceProps { src: string; width: number; height?: number; media: string; fit?: FitOptions; sizes?: string; } export interface PictureProps extends Omit { sources: PictureSourceProps[]; } export function Source(props: PictureSourceProps & { fit?: FitOptions }) { const srcSet = getSrcSet(props.src, props.width, props.height, props.fit ?? "cover"); return ( ); } export function Picture({ sources, src, width, height, fit = "cover", preload, children, ...rest }: PictureProps & { children?: ReactNode }) { return ( {children ?? sources?.map((source, i) => ( ))} {src && } ); } `; files["src/components/ui/Video.tsx"] = `interface Props { src: string; width?: number; height?: number; autoPlay?: boolean; muted?: boolean; loop?: boolean; playsInline?: boolean; controls?: boolean; className?: string; loading?: "lazy" | "eager"; poster?: string; } export default function Video({ src, width, height, autoPlay = true, muted = true, loop = true, playsInline = true, controls = false, className, poster, }: Props) { return (