import { useTranslation } from "next-i18next"; import ErrorBoundary from "components/errorboundry"; import components from "widgets/components"; export default function Widget({ widget, service }) { const { t } = useTranslation("common"); const ServiceWidget = components[widget.type]; const fullService = Object.apply({}, service); fullService.widget = widget; if (ServiceWidget) { return ( ); } return (
{t("widget.missing_type", { type: widget.type })}
); }