import { useTranslation } from "@termix/plugin-sdk/frontend"; import { Type } from "lucide-react"; import { registerWidget } from "./WidgetRegistry"; import type { TextBannerConfig, WidgetComponentProps } from "../types.js"; import { GRID_SIZE } from "../types.js"; const FONT_SIZE_MAP = { sm: "text-xs", md: "text-sm", lg: "text-base", xl: "text-xl", }; const FONT_WEIGHT_MAP = { normal: "font-normal", semibold: "font-semibold", bold: "font-bold", }; const TEXT_ALIGN_MAP = { left: "text-left", center: "text-center", right: "text-right", }; function TextBannerWidget({ config }: WidgetComponentProps) { const { t } = useTranslation(); const { text, fontSize, textAlign, fontWeight, backgroundColor } = config; return (
{text || t("homepage.bannerTextPlaceholder")}
); } registerWidget({ id: "text_banner", name: "Text Banner", description: "A styled text label for sections and headings", category: "info", icon: , defaultConfig: { text: "", fontSize: "lg", textAlign: "center", fontWeight: "semibold", }, defaultSize: { w: GRID_SIZE * 14, h: GRID_SIZE * 3 }, minSize: { w: GRID_SIZE * 3, h: GRID_SIZE * 2 }, component: TextBannerWidget, }); export { TextBannerWidget };