mirror of
https://github.com/fosrl/pangolin.git
synced 2026-05-11 23:04:59 +00:00
fix alerting layout
This commit is contained in:
38
src/app/[orgId]/settings/alerting/(list)/layout.tsx
Normal file
38
src/app/[orgId]/settings/alerting/(list)/layout.tsx
Normal 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>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,38 +1,7 @@
|
|||||||
import SettingsSectionTitle from "@app/components/SettingsSectionTitle";
|
|
||||||
import { HorizontalTabs } from "@app/components/HorizontalTabs";
|
|
||||||
import { getTranslations } from "next-intl/server";
|
|
||||||
|
|
||||||
type AlertingLayoutProps = {
|
type AlertingLayoutProps = {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
params: Promise<{ orgId: string }>;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default async function AlertingLayout({
|
export default function AlertingLayout({ children }: AlertingLayoutProps) {
|
||||||
children,
|
return <>{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>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user