'use client';

import { useParams, useSearchParams } from 'next/navigation';
import { VendorDetail } from '@/components/accounting/VendorManagement/VendorDetail';

export default function VendorDetailPage() {
  const params = useParams();
  const searchParams = useSearchParams();
  const vendorId = params.id as string;
  const mode = searchParams.get('mode') === 'edit' ? 'edit' : 'view';
  const openModal = searchParams.get('modal');

  return <VendorDetail mode={mode} vendorId={vendorId} openModal={openModal} />;
}