'use client';

import { use } from 'react';
import { useSearchParams } from 'next/navigation';
import { PermissionDetailClient } from '@/components/settings/PermissionManagement/PermissionDetailClient';

interface PageProps {
  params: Promise<{ id: string }>;
}

export default function PermissionDetailPage({ params }: PageProps) {
  const { id } = use(params);
  const searchParams = useSearchParams();
  const mode = searchParams.get('mode') as 'view' | 'edit' | null;

  return <PermissionDetailClient permissionId={id} mode={mode || 'view'} />;
}
