import { useState } from 'react'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { LayoutDashboard, Ticket, Bell, Package, Menu, X } from 'lucide-react'
import { DashboardPage } from './pages/DashboardPage'
import { AgentDetailPage } from './pages/AgentDetailPage'
import TicketsPage from './pages/TicketsPage'
import AlertsPage from './pages/AlertsPage'
import SoftwarePage from './pages/SoftwarePage'
import { cn } from './lib/utils'
const queryClient = new QueryClient({
defaultOptions: {
queries: {
staleTime: 30_000,
retry: 2,
},
},
})
type Page = 'dashboard' | 'agent-detail' | 'tickets' | 'alerts' | 'software'
interface NavItem {
id: Page
label: string
icon: React.ReactNode
}
const navItems: NavItem[] = [
{ id: 'dashboard', label: 'Dashboard', icon: },
{ id: 'tickets', label: 'Tickets', icon: },
{ id: 'alerts', label: 'Alerts', icon: },
{ id: 'software', label: 'Software', icon: },
]
function AppContent() {
const [page, setPage] = useState('dashboard')
const [selectedAgentId, setSelectedAgentId] = useState(null)
const [sidebarOpen, setSidebarOpen] = useState(true)
function handleSelectAgent(agentId: string) {
setSelectedAgentId(agentId)
setPage('agent-detail')
}
function handleBack() {
setPage('dashboard')
setSelectedAgentId(null)
}
return (
{/* Sidebar */}
{/* Main content */}
{page === 'dashboard' && (
)}
{page === 'agent-detail' && selectedAgentId && (
)}
{page === 'tickets' && }
{page === 'alerts' && }
{page === 'software' && }
)
}
function App() {
return (
)
}
export default App