import { internal } from "@app/lib/api"; import { authCookieHeader } from "@app/lib/api/cookies"; import { ListOrgLabelsResponse } from "@server/routers/labels/types"; import { AxiosResponse } from "axios"; import OrgLabelsTable from "@app/components/OrgLabelsTable"; import SettingsSectionTitle from "@app/components/SettingsSectionTitle"; import type { Metadata } from "next"; import { getTranslations } from "next-intl/server"; export const metadata: Metadata = { title: "Labels" }; type Props = { params: Promise<{ orgId: string }>; searchParams: Promise>; }; export const dynamic = "force-dynamic"; export default async function LabelsPage({ params, searchParams }: Props) { const { orgId } = await params; const searchParamsObj = new URLSearchParams(await searchParams); let labels: ListOrgLabelsResponse["labels"] = []; let pagination: ListOrgLabelsResponse["pagination"] = { total: 0, page: 1, pageSize: 20 }; try { const res = await internal.get>( `/org/${orgId}/labels?${searchParamsObj.toString()}`, await authCookieHeader() ); const responseData = res.data.data; labels = responseData.labels; pagination = responseData.pagination; } catch (e) {} const t = await getTranslations(); return ( <> ); }