import { redirect } from 'next/navigation';

// Legacy redirect: the admin area moved from /dashboard/admin/* to /admin/*.
// Keeps old links and bookmarks working.
type Params = { locale: string; rest?: string[] };

export default async function LegacyAdminRedirect({ params }: { params: Promise<Params> }) {
  const { locale, rest } = await params;
  const sub = rest && rest.length ? `/${rest.join('/')}` : '';
  redirect(`/${locale}/admin${sub}`);
}
