import { useTypedAppConfig } from "./useTypedAppConfig"; /** * Composable that provides an SVG placeholder image as a data URI * Note: CSS variables and currentColor don't work in data URIs since SVGs are rendered in isolation * * @param color - Hex color for the placeholder (optional - defaults to appConfig.imagePlaceholder.color or #543B95) * @returns Base64-encoded SVG data URI */ export function useImagePlaceholder(color?: string) { const appConfig = useTypedAppConfig(); const placeholderColor = color || appConfig.imagePlaceholder?.color || "#543B95"; const placeholderSvg = `data:image/svg+xml;base64,${btoa( ` `.trim(), )}`; return placeholderSvg; }