Track HiveGrid Cloud planning reference

This commit is contained in:
david committed 2026-06-26 20:48:01 +02:00
1 parent b3d5ea6764
commit e341c5938a
5784 files changed
+1104929 -3

No files matched your search

@@ -0,0 +1,43 @@
import { LoaderFunctionArgs } from "react-router";
import { Outlet, useParams } from "react-router";
import { useTranslation } from "react-i18next";
import IconWidgets from "~/components/layouts/icons/IconWidgets";
import ServerError from "~/components/ui/errors/ServerError";
import SidebarIconsLayout from "~/components/ui/layouts/SidebarIconsLayout";
import { getTranslations } from "~/locale/i18next.server";
import UrlUtils from "~/utils/app/UrlUtils";
import { getAppConfiguration } from "~/utils/db/appConfiguration.db.server";
export const loader = async ({ request, params }: LoaderFunctionArgs) => {
const { t } = await getTranslations(request);
const appConfiguration = await getAppConfiguration({ request });
if (params.tenant && !appConfiguration.widgets.enabled) {
throw Response.json({ error: t("widgets.errors.disabled") }, { status: 400 });
}
return Response.json({});
};
export default function () {
const { t } = useTranslation();
const params = useParams();
return (
<SidebarIconsLayout
label={{ align: "right" }}
items={[
{
name: t("widgets.plural"),
href: UrlUtils.getModulePath(params, `widgets`),
exact: true,
icon: <IconWidgets className="h-5 w-5" />,
iconSelected: <IconWidgets className="h-5 w-5" />,
},
]}
>
<Outlet />
</SidebarIconsLayout>
);
}
export function ErrorBoundary() {
return <ServerError />;
}