rem /dashboard from routes

This commit is contained in:
marko-kraemer 2025-04-21 05:49:18 +01:00
parent a873e3467c
commit 4bfadc4360
25 changed files with 29 additions and 29 deletions

View File

@ -10,7 +10,7 @@ export default async function PersonalAccountBillingPage() {
return (
<div>
<AccountBillingStatus accountId={personalAccount.account_id} returnUrl={`${returnUrl}/dashboard/settings/billing`} />
<AccountBillingStatus accountId={personalAccount.account_id} returnUrl={`${returnUrl}/settings/billing`} />
</div>
)
}

View File

@ -7,9 +7,9 @@ import { usePathname } from "next/navigation";
export default function PersonalAccountSettingsPage({children}: {children: React.ReactNode}) {
const pathname = usePathname();
const items = [
{ name: "Profile", href: "/dashboard/settings" },
{ name: "Teams", href: "/dashboard/settings/teams" },
{ name: "Billing", href: "/dashboard/settings/billing" },
{ name: "Profile", href: "/settings" },
{ name: "Teams", href: "/settings/teams" },
{ name: "Billing", href: "/settings/billing" },
]
return (
<div className="space-y-6 w-full">

View File

@ -16,5 +16,5 @@ export default function AccountRedirect({
const { accountSlug } = unwrappedParams;
// Redirect to the settings page
redirect(`/dashboard/${accountSlug}/settings`);
redirect(`/${accountSlug}/settings`);
}

View File

@ -69,7 +69,7 @@ export default function TeamBillingPage({ params }: { params: Promise<AccountPar
<AccountBillingStatus
accountId={teamAccount.account_id}
returnUrl={`${returnUrl}/dashboard/${accountSlug}/settings/billing`}
returnUrl={`${returnUrl}/${accountSlug}/settings/billing`}
/>
</div>
)

View File

@ -20,9 +20,9 @@ export default function TeamSettingsLayout({
const { accountSlug } = unwrappedParams;
const pathname = usePathname();
const items = [
{ name: "Account", href: `/dashboard/${accountSlug}/settings` },
{ name: "Members", href: `/dashboard/${accountSlug}/settings/members` },
{ name: "Billing", href: `/dashboard/${accountSlug}/settings/billing` },
{ name: "Account", href: `/${accountSlug}/settings` },
{ name: "Members", href: `/${accountSlug}/settings/members` },
{ name: "Billing", href: `/${accountSlug}/settings/billing` },
]
return (
<div className="space-y-6 w-full">

View File

@ -1110,7 +1110,7 @@ export default function ThreadPage({ params }: { params: Promise<ThreadParams> }
<div className="flex w-full max-w-md flex-col items-center gap-4 rounded-lg border bg-card p-6 text-center">
<h2 className="text-lg font-semibold text-destructive">Error</h2>
<p className="text-sm text-muted-foreground">{error}</p>
<Button variant="outline" onClick={() => router.push(`/dashboard/projects/${project?.id || ''}`)}>
<Button variant="outline" onClick={() => router.push(`/projects/${project?.id || ''}`)}>
Back to Project
</Button>
</div>

View File

@ -80,7 +80,7 @@ export default function AgentsPage() {
</p>
</div>
<Button asChild>
<Link href="/dashboard/agents/new">
<Link href="/agents/new">
<PlusCircle className="mr-2 h-4 w-4" />
New Agent
</Link>
@ -110,7 +110,7 @@ export default function AgentsPage() {
Create your first agent to start automating tasks and getting help from AI.
</p>
<Button asChild>
<Link href="/dashboard/agents/new">
<Link href="/agents/new">
<PlusCircle className="mr-2 h-4 w-4" />
Create your first agent
</Link>
@ -133,7 +133,7 @@ export default function AgentsPage() {
<Link
href={
agent.threadId
? `/dashboard/agents/${agent.threadId}`
? `/agents/${agent.threadId}`
: `/dashboard`
}
>

View File

@ -48,7 +48,7 @@ function DashboardContent() {
localStorage.removeItem(PENDING_PROMPT_KEY);
// 5. Navigate to the new agent's thread page
router.push(`/dashboard/agents/${thread.thread_id}`);
router.push(`/agents/${thread.thread_id}`);
} catch (error) {
console.error("Error creating agent:", error);
setIsSubmitting(false);

View File

@ -58,10 +58,10 @@ export default function ClientUserAccountButton({
<Link href="/dashboard" className="flex w-full h-full text-foreground/90">My Account</Link>
</DropdownMenuItem>
<DropdownMenuItem asChild className="rounded-md hover:bg-hover-bg cursor-pointer">
<Link href="/dashboard/settings" className="flex w-full h-full text-foreground/90">Settings</Link>
<Link href="/settings" className="flex w-full h-full text-foreground/90">Settings</Link>
</DropdownMenuItem>
<DropdownMenuItem asChild className="rounded-md hover:bg-hover-bg cursor-pointer">
<Link href="/dashboard/settings/teams" className="flex w-full h-full text-foreground/90">Teams</Link>
<Link href="/settings/teams" className="flex w-full h-full text-foreground/90">Teams</Link>
</DropdownMenuItem>
</DropdownMenuGroup>
<DropdownMenuSeparator className="border-subtle dark:border-white/10" />

View File

@ -39,7 +39,7 @@ export default async function ManageTeams() {
asChild
className="rounded-lg h-9 border-subtle dark:border-white/10 hover:bg-hover-bg dark:hover:bg-hover-bg-dark"
>
<Link href={`/dashboard/${team.slug}`}>View</Link>
<Link href={`/${team.slug}`}>View</Link>
</Button>
</TableCell>
</TableRow>

View File

@ -79,7 +79,7 @@ export default function NewTeamForm() {
<p>
This will be used for your team URL:
<span className="block text-primary font-medium mt-0.5">
yourapp.com/dashboard/{slugValue || "team-name"}
yourapp.com/{slugValue || "team-name"}
</span>
</p>
</div>

View File

@ -47,10 +47,10 @@ export default async function UserAccountButton() {
<Link href="/dashboard">My Account</Link>
</DropdownMenuItem>
<DropdownMenuItem asChild>
<Link href="/dashboard/settings">Settings</Link>
<Link href="/settings">Settings</Link>
</DropdownMenuItem>
<DropdownMenuItem asChild>
<Link href="/dashboard/settings/teams">Teams</Link>
<Link href="/settings/teams">Teams</Link>
</DropdownMenuItem>
</DropdownMenuGroup>
<DropdownMenuSeparator />

View File

@ -118,7 +118,7 @@ export function HeroSection() {
});
// 5. Navigate to the new agent's thread page
router.push(`/dashboard/agents/${thread.thread_id}`);
router.push(`/agents/${thread.thread_id}`);
} catch (error) {
console.error("Error creating agent:", error);
setIsSubmitting(false);

View File

@ -104,7 +104,7 @@ export function NavAgents() {
threadId: thread.thread_id,
projectId: projectId,
projectName: project.name || 'Unnamed Project',
url: `/dashboard/agents/${thread.thread_id}`,
url: `/agents/${thread.thread_id}`,
updatedAt: thread.updated_at || project.updated_at || new Date().toISOString()
});
}

View File

@ -131,7 +131,7 @@ export function NavUserWithTeams({
if (team.personal_account) {
router.push('/dashboard')
} else {
router.push(`/dashboard/${team.slug}`)
router.push(`/${team.slug}`)
}
}
@ -268,13 +268,13 @@ export function NavUserWithTeams({
{/* User Settings Section */}
<DropdownMenuGroup>
<DropdownMenuItem asChild>
<Link href="/dashboard/settings/billing">
<Link href="/settings/billing">
<CreditCard className="mr-2 h-4 w-4" />
Billing
</Link>
</DropdownMenuItem>
<DropdownMenuItem asChild>
<Link href="/dashboard/settings">
<Link href="/settings">
<Settings className="mr-2 h-4 w-4" />
Settings
</Link>

View File

@ -25,7 +25,7 @@ export async function createInvitation(prevState: any, formData: FormData): Prom
};
}
revalidatePath(`/dashboard/[accountSlug]/settings/members/page`);
revalidatePath(`/[accountSlug]/settings/members/page`);
return {
token: data.token as string
@ -69,6 +69,6 @@ export async function acceptInvitation(prevState: any, formData: FormData) {
message: error.message
};
}
redirect(`/dashboard/${data.slug}`);
redirect(`/${data.slug}`);
};

View File

@ -21,7 +21,7 @@ export async function createTeam(prevState: any, formData: FormData) {
};
}
redirect(`/dashboard/${data.slug}`);
redirect(`/${data.slug}`);
};
@ -62,5 +62,5 @@ export async function editTeamSlug(prevState: any, formData: FormData) {
};
}
redirect(`/dashboard/${data.slug}/settings`);
redirect(`/${data.slug}/settings`);
};