"use client";
import { useState } from "react";
import { TimesheetDemo } from "./timesheet-demo";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
import { Progress } from "@/components/ui/progress";
import { Input } from "@/components/ui/input";
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select";
import {
Calendar,
Check,
X,
Clock,
User,
Package,
Star,
Heart,
ShoppingCart,
Edit,
Trash2,
Phone,
Mail,
MapPin,
Building,
TrendingUp,
Award,
Users,
Briefcase,
Eye,
Plus,
Minus,
Store,
Boxes,
ChevronDown,
ChevronRight,
Hash,
Package2,
Truck,
} from "lucide-react";
export function BusinessDemo() {
const [selectedProduct] = useState(null);
const [cartQuantity, setCartQuantity] = useState(1);
const [expandedSeller, setExpandedSeller] = useState(false);
// Данные для демонстрации
const scheduleData = Array.from({ length: 30 }, (_, i) => ({
day: i + 1,
status: ["work", "work", "work", "work", "work", "weekend", "weekend"][
i % 7
],
hours: [8, 8, 8, 8, 8, 0, 0][i % 7],
}));
const products = [
{
id: "1",
name: "iPhone 15 Pro Max 256GB",
article: "APL-IP15PM-256",
price: 89990,
oldPrice: 99990,
quantity: 45,
category: "Электроника",
brand: "Apple",
rating: 4.8,
reviews: 1234,
image: "/placeholder-phone.jpg",
seller: "TechStore Moscow",
isNew: true,
inStock: true,
},
{
id: "2",
name: "Беспроводные наушники AirPods Pro",
article: "APL-APP-PRO",
price: 24990,
quantity: 23,
category: "Аксессуары",
brand: "Apple",
rating: 4.6,
reviews: 856,
image: "/placeholder-headphones.jpg",
seller: "Audio Expert",
isNew: false,
inStock: true,
},
{
id: "3",
name: "Ноутбук MacBook Air M2",
article: "APL-MBA-M2",
price: 0,
quantity: 0,
category: "Компьютеры",
brand: "Apple",
rating: 4.9,
reviews: 445,
image: "/placeholder-laptop.jpg",
seller: "Digital World",
isNew: false,
inStock: false,
},
];
// Данные для поставки фулфилмента
const fulfillmentSupply = {
id: "1",
supplyNumber: "ФФ-2024-001",
supplyDate: "2024-01-15",
seller: {
id: "seller1",
name: "TechStore LLC",
storeName: "ТехноМагазин",
managerName: "Иванов Иван Иванович",
phone: "+7 (495) 123-45-67",
email: "contact@techstore.ru",
inn: "7701234567",
},
itemsQuantity: 150,
cargoPlaces: 5,
volume: 12.5,
responsibleEmployeeId: "emp1",
logisticsPartnerId: "log1",
status: "planned",
totalValue: 2500000,
};
const employees = [
{
id: "emp1",
firstName: "Иван",
lastName: "Петров",
position: "Менеджер склада",
},
{
id: "emp2",
firstName: "Мария",
lastName: "Сидорова",
position: "Логист",
},
];
const logisticsPartners = [
{ id: "log1", name: "ТК Энергия", fullName: "ООО ТК Энергия" },
{ id: "log2", name: "СДЭК", fullName: "ООО СДЭК" },
];
const wholesalers = [
{
id: "1",
name: "ТехноОпт Москва",
fullName: 'ООО "Технологии Оптом"',
inn: "7735123456",
type: "WHOLESALE",
avatar: "/placeholder-company.jpg",
rating: 4.8,
reviewsCount: 2345,
productsCount: 15670,
completedOrders: 8934,
responseTime: "2 часа",
categories: ["Электроника", "Компьютеры", "Аксессуары"],
location: "Москва, Россия",
workingSince: "2018",
verifiedBadges: ["verified", "premium", "fast-delivery"],
description:
"Крупнейший поставщик электроники и компьютерной техники в России",
specialOffers: 3,
minOrder: 50000,
},
{
id: "2",
name: "СтройБаза Регион",
fullName: "ИП Строительные материалы",
inn: "7735987654",
type: "WHOLESALE",
avatar: "/placeholder-construction.jpg",
rating: 4.5,
reviewsCount: 1876,
productsCount: 8430,
completedOrders: 5621,
responseTime: "4 часа",
categories: ["Стройматериалы", "Инструменты", "Сантехника"],
location: "Екатеринбург, Россия",
workingSince: "2015",
verifiedBadges: ["verified", "eco-friendly"],
description: "Надежный поставщик строительных материалов по всей России",
specialOffers: 1,
minOrder: 30000,
},
];
const getStatusColor = (status: string) => {
switch (status) {
case "work":
return "bg-green-500";
case "weekend":
return "bg-gray-400";
case "vacation":
return "bg-blue-500";
case "sick":
return "bg-yellow-500";
case "absent":
return "bg-red-500";
default:
return "bg-gray-400";
}
};
const getStatusText = (status: string) => {
switch (status) {
case "work":
return "Работа";
case "weekend":
return "Выходной";
case "vacation":
return "Отпуск";
case "sick":
return "Больничный";
case "absent":
return "Прогул";
default:
return "Неизвестно";
}
};
const formatPrice = (price: number) => {
return new Intl.NumberFormat("ru-RU", {
style: "currency",
currency: "RUB",
minimumFractionDigits: 0,
}).format(price);
};
const formatCurrency = (amount: number) => {
return new Intl.NumberFormat("ru-RU", {
style: "currency",
currency: "RUB",
minimumFractionDigits: 0,
}).format(amount);
};
const formatDate = (dateString: string) => {
return new Date(dateString).toLocaleDateString("ru-RU", {
day: "2-digit",
month: "2-digit",
year: "numeric",
});
};
const getStatusBadge = (status: string) => {
const statusConfig = {
planned: {
color: "text-blue-300 border-blue-400/30",
label: "Запланировано",
},
"in-transit": {
color: "text-yellow-300 border-yellow-400/30",
label: "В пути",
},
delivered: {
color: "text-green-300 border-green-400/30",
label: "Доставлено",
},
"in-processing": {
color: "text-purple-300 border-purple-400/30",
label: "Обрабатывается",
},
};
const config =
statusConfig[status as keyof typeof statusConfig] || statusConfig.planned;
return (
Менеджер по продажам • Март 2024
176 часов
Отработано в месяце
Артикул: {product.article}
В наличии: {product.quantity} шт.
)}Юридическое название
{fulfillmentSupply.seller.name}
ИНН
{fulfillmentSupply.seller.inn}
{fulfillmentSupply.seller.email}
Номер
{fulfillmentSupply.supplyNumber}
Дата
{formatDate(fulfillmentSupply.supplyDate)}
Товаров
{fulfillmentSupply.itemsQuantity}
Мест
{fulfillmentSupply.cargoPlaces}
Объём
{fulfillmentSupply.volume} м³
Стоимость
{formatCurrency(fulfillmentSupply.totalValue)}
Ответственный
Логистика
Статус
{wholesaler.fullName}
ИНН: {wholesaler.inn}
{/* Рейтинг и статистика */}{wholesaler.description}
{/* Статистика */}Категории: