fix alerting layout

This commit is contained in:
miloschwartz
2026-04-21 16:54:28 -07:00
parent db2942447a
commit 22a6dabeb2
4 changed files with 40 additions and 33 deletions

View File

@@ -0,0 +1,38 @@
import SettingsSectionTitle from "@app/components/SettingsSectionTitle";
import { HorizontalTabs } from "@app/components/HorizontalTabs";
import { getTranslations } from "next-intl/server";
type AlertingListLayoutProps = {
children: React.ReactNode;
params: Promise<{ orgId: string }>;
};
export default async function AlertingListLayout({
children,
params
}: AlertingListLayoutProps) {
const { orgId } = await params;
const t = await getTranslations();
const navItems = [
{
title: t("alertingTabRules"),
href: `/${orgId}/settings/alerting/rules`,
activePrefix: `/${orgId}/settings/alerting`
},
{
title: t("alertingTabHealthChecks"),
href: `/${orgId}/settings/alerting/health-checks`
}
];
return (
<>
<SettingsSectionTitle
title={t("alertingTitle")}
description={t("alertingDescription")}
/>
<HorizontalTabs items={navItems}>{children}</HorizontalTabs>
</>
);
}

View File

@@ -1,38 +1,7 @@
import SettingsSectionTitle from "@app/components/SettingsSectionTitle";
import { HorizontalTabs } from "@app/components/HorizontalTabs";
import { getTranslations } from "next-intl/server";
type AlertingLayoutProps = {
children: React.ReactNode;
params: Promise<{ orgId: string }>;
};
export default async function AlertingLayout({
children,
params
}: AlertingLayoutProps) {
const { orgId } = await params;
const t = await getTranslations();
const navItems = [
{
title: t("alertingTabRules"),
href: `/${orgId}/settings/alerting/rules`,
activePrefix: `/${orgId}/settings/alerting`
},
{
title: t("alertingTabHealthChecks"),
href: `/${orgId}/settings/alerting/health-checks`
}
];
return (
<>
<SettingsSectionTitle
title={t("alertingTitle")}
description={t("alertingDescription")}
/>
<HorizontalTabs items={navItems}>{children}</HorizontalTabs>
</>
);
export default function AlertingLayout({ children }: AlertingLayoutProps) {
return <>{children}</>;
}