'use client';

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

export default function PermissionsPage() {
  const searchParams = useSearchParams();
  const mode = searchParams.get('mode');

  if (mode === 'new') {
    return <PermissionDetailClient permissionId="new" isNew />;
  }

  return <PermissionManagement />;
}
