import type { Item } from "@/types";
import { cfgStr } from "@/widgets/index";
import { t } from "@/i18n";
// Embed — sandboxed iframe. Fully client-side; the tile chrome still shows
// the item name above the frame.
export function EmbedWidget({ item }: { item: Item }) {
const url = cfgStr(item, "url");
// Block script-capable schemes; http(s)/relative URLs are fine.
const bad = /^\s*(javascript|data|vbscript|file):/i.test(url);
if (!url || bad) {
return {t("widget.embedHint")};
}
return (
);
}