import { h } from 'preact'; import type { Widget } from '../lib/types'; interface Props { widget: Widget; onContextMenu?: (e: MouseEvent) => void; onNavigate?: (interfaceId: string) => void; } export default function LinkWidget({ widget, onContextMenu, onNavigate }: Props) { const target = widget.options['target'] ?? ''; const label = widget.options['label'] ?? target ?? 'Open'; const icon = widget.options['icon'] ?? '↗'; function handleClick(e: MouseEvent) { e.preventDefault(); if (target && onNavigate) onNavigate(target); } return (
); }