* esm * wip * wip * wip * wip * wip * wip * subscription notice * wip * wip * wip * fix envs * fix: update docker build * fix * esm/types * delete dashboard :D * add patches to dockerfiles * update packages + catalogs + ts * wip * remove native libs * ts * improvements * fix redirects and fetching session * try fix favicon * fixes * fix * order and resize reportds within a dashboard * improvements * wip * added userjot to dashboard * fix * add op * wip * different cache key * improve date picker * fix table * event details loading * redo onboarding completely * fix login * fix * fix * extend session, billing and improve bars * fix * reduce price on 10M
74 lines
1.8 KiB
TypeScript
74 lines
1.8 KiB
TypeScript
import FullPageLoadingState from '@/components/full-page-loading-state';
|
|
import { PageHeader } from '@/components/page-header';
|
|
import { Tabs, TabsList, TabsTrigger } from '@/components/ui/tabs';
|
|
import { usePageTabs } from '@/hooks/use-page-tabs';
|
|
import { PAGE_TITLES, createOrganizationTitle } from '@/utils/title';
|
|
import { Outlet, createFileRoute, useRouter } from '@tanstack/react-router';
|
|
|
|
export const Route = createFileRoute(
|
|
'/_app/$organizationId/integrations/_tabs',
|
|
)({
|
|
component: Component,
|
|
loader: async ({ context, params }) => {
|
|
const organization = await context.queryClient.fetchQuery(
|
|
context.trpc.organization.get.queryOptions({
|
|
organizationId: params.organizationId,
|
|
}),
|
|
);
|
|
return { organization };
|
|
},
|
|
head: ({ loaderData }) => {
|
|
return {
|
|
meta: [
|
|
{
|
|
title: createOrganizationTitle(
|
|
PAGE_TITLES.INTEGRATIONS,
|
|
loaderData?.organization?.name,
|
|
),
|
|
},
|
|
],
|
|
};
|
|
},
|
|
pendingComponent: FullPageLoadingState,
|
|
});
|
|
|
|
function Component() {
|
|
const router = useRouter();
|
|
|
|
const { activeTab, tabs } = usePageTabs([
|
|
{ id: 'installed', label: 'Installed' },
|
|
{ id: 'available', label: 'Available' },
|
|
]);
|
|
|
|
const handleTabChange = (tabId: string) => {
|
|
router.navigate({
|
|
from: Route.fullPath,
|
|
to: tabId,
|
|
});
|
|
};
|
|
|
|
return (
|
|
<div className="container p-8">
|
|
<PageHeader
|
|
title="Integrations"
|
|
description="Manage your integrations here"
|
|
/>
|
|
|
|
<Tabs
|
|
value={activeTab}
|
|
onValueChange={handleTabChange}
|
|
className="mt-2 mb-8"
|
|
>
|
|
<TabsList>
|
|
{tabs.map((tab) => (
|
|
<TabsTrigger key={tab.id} value={tab.id}>
|
|
{tab.label}
|
|
</TabsTrigger>
|
|
))}
|
|
</TabsList>
|
|
</Tabs>
|
|
<Outlet />
|
|
</div>
|
|
);
|
|
}
|