'use client' import { useState, useEffect } from 'react' import dynamic from 'next/dynamic' import { useRouter } from 'next/navigation' import { useTranslations } from 'next-intl' import { createClient } from '@/lib/supabase/client' import { Button } from '@/components/ui/button' import { Input } from '@/components/ui/input' import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from '@/components/ui/dialog' import { EmptyState } from '@/components/ui/empty-state' import { Skeleton } from '@/components/ui/skeleton' import { TH_CLASS, TD_CLASS } from '@/components/ui/dry-table' import { ReportExportMenu } from '@/components/reports/ReportExportMenu' import { useToast } from '@/components/ui/use-toast' import { Plus, Search, Building2, Lock } from 'lucide-react' import Link from 'next/link' import { cn } from '@/lib/utils' import { useCompany } from '@/contexts/CompanyContext' import { useCanWrite } from '@/lib/hooks/use-can-write' import type { Supplier, SupplierType, CreateSupplierInput } from '@/types' const SupplierForm = dynamic( () => import('@/components/suppliers/SupplierForm'), { loading: () => (
| {t('th_name')} | {t('th_type')} | {t('th_payment')} | {t('th_email')} | {t('th_org_number')} |
|---|---|---|---|---|
| e.stopPropagation()} > {supplier.name} | {t(SUPPLIER_TYPE_KEYS[supplier.supplier_type])} | {payment ? `${payment.label} ${payment.value}` : ''} | {supplier.email || ''} | {supplier.org_number || ''} |
{t('count_summary', { count: suppliers.length })}
{visibleCount < filteredSuppliers.length && (