"use client"
/* eslint-disable @typescript-eslint/no-explicit-any */

import React, { useState } from 'react'
import { useAuth } from '@/hooks/useAuth'
import { Sidebar } from '@/components/dashboard/sidebar'
import { useSidebar } from '@/hooks/useSidebar'
import { Card } from '@/components/ui/card'
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'
import { WildberriesWarehouseTab } from './wildberries-warehouse-tab'
import { MyWarehouseTab } from './my-warehouse-tab'
import { FulfillmentWarehouseTab } from './fulfillment-warehouse-tab'

export function WBWarehouseDashboard() {
  const { user } = useAuth()
  const { isCollapsed, getSidebarMargin } = useSidebar()
  const [activeTab, setActiveTab] = useState('fulfillment')

  return (
    <div className="h-screen flex overflow-hidden">
      <Sidebar />
      <main className={`flex-1 ${getSidebarMargin()} px-6 py-4 overflow-hidden transition-all duration-300`}>
        <div className="h-full w-full flex flex-col">
          {/* Табы */}
          <Tabs value={activeTab} onValueChange={setActiveTab} className="flex-1 flex flex-col">
            <TabsList className="grid grid-cols-3 w-full max-w-md mb-6 bg-white/5 border border-white/10">
              <TabsTrigger 
                value="fulfillment" 
                className="data-[state=active]:bg-blue-600 data-[state=active]:text-white text-white/60"
              >
                Склад фулфилмент
              </TabsTrigger>
              <TabsTrigger 
                value="wildberries" 
                className="data-[state=active]:bg-blue-600 data-[state=active]:text-white text-white/60"
              >
                Склад Wildberries
              </TabsTrigger>
              <TabsTrigger 
                value="my-warehouse" 
                className="data-[state=active]:bg-blue-600 data-[state=active]:text-white text-white/60"
              >
                Мой склад
              </TabsTrigger>
            </TabsList>

            <div className="flex-1 overflow-hidden">
              <TabsContent value="fulfillment" className="h-full mt-0">
                <FulfillmentWarehouseTab />
              </TabsContent>
              
              <TabsContent value="wildberries" className="h-full mt-0">
                <WildberriesWarehouseTab />
              </TabsContent>
              
              <TabsContent value="my-warehouse" className="h-full mt-0">
                <MyWarehouseTab />
              </TabsContent>
            </div>
          </Tabs>
        </div>
      </main>
    </div>
  )
} 