diff --git a/src/app/(authenticated)/dashboard/layout.tsx b/src/app/(authenticated)/dashboard/layout.tsx
index 848af4f664..c295afd7f6 100644
--- a/src/app/(authenticated)/dashboard/layout.tsx
+++ b/src/app/(authenticated)/dashboard/layout.tsx
@@ -1,4 +1,3 @@
-import { useTranslations } from 'next-intl';
import { getLocale, getTranslations } from 'next-intl/server';
import { DashboardHeader } from '@/components/dashboard/DashboardHeader';
@@ -9,35 +8,21 @@ export async function generateMetadata() {
return { title: t('meta_title'), description: t('meta_description') };
}
-export default function DashboardLayout(props: { children: React.ReactNode }) {
- const t = useTranslations('DashboardLayout');
-
+export default function DashboardLayout({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
return (
<>
-
- {props.children}
+ {children}
>
diff --git a/src/app/(authenticated)/dashboard/organization-profile/[[...organization-profile]]/page.tsx b/src/app/(authenticated)/dashboard/organization-profile/[[...organization-profile]]/page.tsx
index b458d2e6f8..0f633bb973 100644
--- a/src/app/(authenticated)/dashboard/organization-profile/[[...organization-profile]]/page.tsx
+++ b/src/app/(authenticated)/dashboard/organization-profile/[[...organization-profile]]/page.tsx
@@ -12,17 +12,11 @@ export default function Page() {
title={t('title_bar')}
description={t('title_bar_description')}
/>
-
>
);
diff --git a/src/app/(authenticated)/onboarding/organization-selection/page.tsx b/src/app/(authenticated)/onboarding/organization-selection/page.tsx
deleted file mode 100644
index 7605507524..0000000000
--- a/src/app/(authenticated)/onboarding/organization-selection/page.tsx
+++ /dev/null
@@ -1,29 +0,0 @@
-import { OrganizationList } from '@clerk/nextjs';
-import { getTranslations } from 'next-intl/server';
-
-export async function generateMetadata(props: { params: { locale: string } }) {
- const t = await getTranslations({
- locale: props.params.locale,
- namespace: 'Dashboard',
- });
-
- return {
- title: t('meta_title'),
- description: t('meta_description'),
- };
-}
-
-const OrganizationSelectionPage = () => (
-
-
-
-);
-
-export const dynamic = 'force-dynamic';
-
-export default OrganizationSelectionPage;
diff --git a/src/app/onboarding/create-org/page.tsx b/src/app/onboarding/create-org/page.tsx
new file mode 100644
index 0000000000..158f936d73
--- /dev/null
+++ b/src/app/onboarding/create-org/page.tsx
@@ -0,0 +1,29 @@
+import { redirect } from 'next/navigation';
+import { CreateOrganization } from '@clerk/nextjs';
+import { auth as clerkAuth } from '@clerk/nextjs/server';
+import { getLocale, getTranslations } from 'next-intl/server';
+
+export async function generateMetadata() {
+ const locale = await getLocale();
+ const t = await getTranslations({ locale, namespace: 'Dashboard' });
+ return { title: t('meta_title'), description: t('meta_description') };
+}
+
+export const dynamic = 'force-dynamic';
+
+export default async function Page() {
+ const auth = await clerkAuth();
+
+ if (!auth.userId) {
+ redirect('/');
+ }
+
+ return (
+
+
+
+ );
+}
diff --git a/src/app/onboarding/select-org/page.tsx b/src/app/onboarding/select-org/page.tsx
new file mode 100644
index 0000000000..bb3851fa3c
--- /dev/null
+++ b/src/app/onboarding/select-org/page.tsx
@@ -0,0 +1,29 @@
+import { redirect } from 'next/navigation';
+import { OrganizationList } from '@clerk/nextjs';
+import { auth as clerkAuth } from '@clerk/nextjs/server';
+import { getLocale, getTranslations } from 'next-intl/server';
+
+export async function generateMetadata() {
+ const locale = await getLocale();
+ const t = await getTranslations({ locale, namespace: 'Dashboard' });
+ return { title: t('meta_title'), description: t('meta_description') };
+}
+
+export const dynamic = 'force-dynamic';
+
+export default async function Page() {
+ const auth = await clerkAuth();
+
+ if (!auth.userId) {
+ redirect('/');
+ }
+
+ return (
+
+
+
+ );
+}
diff --git a/src/components/dashboard/DashboardHeader.tsx b/src/components/dashboard/DashboardHeader.tsx
index 647fec969f..18ef1638df 100644
--- a/src/components/dashboard/DashboardHeader.tsx
+++ b/src/components/dashboard/DashboardHeader.tsx
@@ -1,7 +1,13 @@
'use client';
-import { OrganizationSwitcher, UserButton } from '@clerk/nextjs';
+import { useMemo } from 'react';
import Link from 'next/link';
+import {
+ OrganizationSwitcher,
+ UserButton,
+ useOrganization,
+} from '@clerk/nextjs';
+import { useTranslations } from 'next-intl';
import { ActiveLink } from '@/components/ActiveLink';
import { LocaleSwitcher } from '@/components/LocaleSwitcher';
@@ -16,85 +22,94 @@ import {
} from '@/components/ui';
import { Logo } from '@/components/templates/Logo';
-type DashboardHeaderProps = {
- menu: {
- href: string;
- label: string;
- }[];
-};
+export const DashboardHeader = () => {
+ const t = useTranslations('DashboardLayout');
+ const { organization } = useOrganization();
-export const DashboardHeader = (props: DashboardHeaderProps) => (
- <>
-
-
-
-
-
-
-
+ >
+ );
+};
diff --git a/src/components/dashboard/DashboardSection.tsx b/src/components/dashboard/DashboardSection.tsx
index 53cc36436f..dda186c188 100644
--- a/src/components/dashboard/DashboardSection.tsx
+++ b/src/components/dashboard/DashboardSection.tsx
@@ -1,17 +1,21 @@
-export const DashboardSection = (props: {
+type DashboardSectionProps = {
title: string;
description: string;
children: React.ReactNode;
-}) => (
+};
+
+export const DashboardSection = ({
+ title,
+ description,
+ children,
+}: DashboardSectionProps) => (
-
{props.title}
-
+
{title}
- {props.description}
+ {description}
-
- {props.children}
+ {children}
);
diff --git a/src/lib/server/Logger.ts b/src/lib/server/Logger.ts
index 7435a65bd7..f01a8f2068 100644
--- a/src/lib/server/Logger.ts
+++ b/src/lib/server/Logger.ts
@@ -11,18 +11,12 @@ if (Env.LOGTAIL_SOURCE_TOKEN) {
stream = pino.multistream([
await logtail({
sourceToken: Env.LOGTAIL_SOURCE_TOKEN,
- options: {
- sendLogsToBetterStack: true,
- },
+ options: { sendLogsToBetterStack: true },
}),
- {
- stream: pretty(), // Prints logs to the console
- },
+ { stream: pretty() }, // Prints logs to the console
]);
} else {
- stream = pretty({
- colorize: true,
- });
+ stream = pretty({ colorize: true });
}
export const logger = pino({ base: undefined }, stream);