Добавлены новые зависимости, обновлены стили и улучшена структура проекта. Обновлен README с описанием функционала и технологий. Реализована анимация и адаптивный дизайн. Настроена авторизация с использованием Apollo Client.

This commit is contained in:
Bivekich
2025-07-16 18:00:41 +03:00
parent d260749bc9
commit 823ef9a28c
69 changed files with 15539 additions and 210 deletions

View File

@ -0,0 +1,109 @@
"use client"
import { useAuth } from '@/hooks/useAuth'
import { Card } from '@/components/ui/card'
import { Building2, Phone } from 'lucide-react'
import { Sidebar } from './sidebar'
export function DashboardHome() {
const { user } = useAuth()
const getOrganizationName = () => {
if (user?.organization?.name) {
return user.organization.name
}
if (user?.organization?.fullName) {
return user.organization.fullName
}
return 'Вашей организации'
}
const getCabinetType = () => {
if (!user?.organization?.type) return 'кабинета'
switch (user.organization.type) {
case 'FULFILLMENT':
return 'фулфилмент кабинета'
case 'SELLER':
return 'селлер кабинета'
case 'LOGIST':
return 'логистического кабинета'
case 'WHOLESALE':
return 'оптового кабинета'
default:
return 'кабинета'
}
}
return (
<div className="min-h-screen bg-gradient-smooth flex">
<Sidebar />
<main className="flex-1 ml-64">
<div className="p-8">
<div className="mb-8">
<h1 className="text-3xl font-bold text-white mb-2">
Добро пожаловать!
</h1>
<p className="text-white/80">
Главная панель управления {getCabinetType()}
</p>
</div>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
{/* Информация об организации */}
<Card className="bg-white/10 backdrop-blur border-white/20 p-6">
<div className="flex items-center space-x-3 mb-4">
<Building2 className="h-8 w-8 text-purple-400" />
<h3 className="text-xl font-semibold text-white">Организация</h3>
</div>
<div className="space-y-2">
<p className="text-white font-medium">
{getOrganizationName()}
</p>
{user?.organization?.inn && (
<p className="text-white/60 text-sm">
ИНН: {user.organization.inn}
</p>
)}
</div>
</Card>
{/* Контактная информация */}
<Card className="bg-white/10 backdrop-blur border-white/20 p-6">
<div className="flex items-center space-x-3 mb-4">
<Phone className="h-8 w-8 text-green-400" />
<h3 className="text-xl font-semibold text-white">Контакты</h3>
</div>
<div className="space-y-2">
<p className="text-white font-medium">
+{user?.phone}
</p>
<p className="text-white/60 text-sm">
Основной номер
</p>
</div>
</Card>
{/* Статистика или дополнительная информация */}
<Card className="bg-white/10 backdrop-blur border-white/20 p-6">
<div className="flex items-center space-x-3 mb-4">
<div className="h-8 w-8 bg-blue-500 rounded-full flex items-center justify-center">
<span className="text-white text-sm font-bold">SF</span>
</div>
<h3 className="text-xl font-semibold text-white">SferaV</h3>
</div>
<div className="space-y-2">
<p className="text-white font-medium">
Система управления бизнесом
</p>
<p className="text-white/60 text-sm">
Версия 1.0
</p>
</div>
</Card>
</div>
</div>
</main>
</div>
)
}