'use client'

import { Package } from 'lucide-react'
import React from 'react'

import { Card } from '@/components/ui/card'
import { useAuthContext } from '@/contexts/AuthContext'

import { MultiLevelSuppliesTable } from '../multilevel-supplies-table'

interface AllSuppliesTabProps {
  pendingSupplyOrders?: number
  goodsSupplies?: any[] // Данные поставок товаров из обоих источников
  loading?: boolean
}

export function AllSuppliesTab({ pendingSupplyOrders = 0, goodsSupplies = [], loading = false }: AllSuppliesTabProps) {
  const { user } = useAuthContext()

  // ✅ ЕДИНАЯ ТАБЛИЦА ПОСТАВОК ТОВАРОВ согласно rules2.md 9.5.3
  return (
    <div className="h-full">
      <MultiLevelSuppliesTable 
        supplies={goodsSupplies} 
        loading={loading}
        userRole="SELLER"
        onSupplyAction={(supplyId: string, action: string) => {
          console.log('Seller action:', action, supplyId)
          // TODO: Добавить обработку действий селлера (отмена поставки)
        }}
      />
    </div>
  )
}
