'use client';

import { useSearchParams } from 'next/navigation';
import { NonconformingList } from '@/components/material/nonconforming/NonconformingList';
import { NonconformingForm } from '@/components/material/nonconforming/NonconformingForm';

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

  if (mode === 'new') {
    return <NonconformingForm mode="new" />;
  }

  return <NonconformingList />;
}
