import { h } from 'preact'; import type { Widget } from '../lib/types'; interface Props { widget: Widget; onContextMenu?: (e: MouseEvent) => void; } export default function ImageWidget({ widget, onContextMenu }: Props) { const url = widget.options['url'] ?? ''; const fit = widget.options['fit'] ?? 'contain'; // contain | cover | fill const alt = widget.options['alt'] ?? ''; const border = widget.options['border'] !== 'false'; return (
{url ? {alt} : No URL }
); }