'use client';

/**
 * 작업지시 목록 페이지
 * URL: /production/work-orders
 * - ?mode=new: 작업지시 등록
 */

import { useSearchParams } from 'next/navigation';
import { WorkOrderList, WorkOrderCreate } from '@/components/production/WorkOrders';

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

  // mode=new: 작업지시 등록
  if (mode === 'new') {
    return <WorkOrderCreate />;
  }

  return <WorkOrderList />;
}