input update max length

This commit is contained in:
Samandar Turgunboyev
2025-12-17 09:32:53 +05:00
parent 817a1a8727
commit c69db3cd3a
2 changed files with 4 additions and 79 deletions

View File

@@ -18,9 +18,7 @@ import {
Package,
RefreshCw,
ShoppingBag,
TrendingUp,
Truck,
Wallet,
} from 'lucide-react';
import { useState } from 'react';
import { orders, user } from '../lib/data';
@@ -86,12 +84,6 @@ const Profile = () => {
{ id: 'history', label: 'Tarix', icon: History },
];
const statistics = {
delivered: orders.filter((o) => o.status === 'delivered').length,
inTransit: orders.filter((o) => o.status === 'inTransit').length,
atPickup: orders.filter((o) => o.status === 'atPickup').length,
};
const renderContent = () => {
switch (activeSection) {
case 'orders':
@@ -114,74 +106,6 @@ const Profile = () => {
default:
return (
<>
<div className="grid grid-cols-2 gap-3 md:gap-4 mb-6 md:mb-8">
<Card className="border-0 shadow-sm bg-gradient-to-br from-emerald-500 to-emerald-600 text-white">
<CardContent className="p-3 md:p-5">
<div className="flex items-center justify-between mb-2 md:mb-3">
<div className="w-8 h-8 md:w-10 md:h-10 rounded-xl bg-white/20 flex items-center justify-center">
<ShoppingBag className="w-4 h-4 md:w-5 md:h-5" />
</div>
<TrendingUp className="w-3 h-3 md:w-4 md:h-4 opacity-75" />
</div>
<p className="text-xl md:text-2xl font-bold">
{user.totalOrders}
</p>
<p className="text-[10px] md:text-sm opacity-80">
Jami buyurtmalar
</p>
</CardContent>
</Card>
<Card className="border-0 shadow-sm bg-gradient-to-br from-blue-500 to-blue-600 text-white">
<CardContent className="p-3 md:p-5">
<div className="flex items-center justify-between mb-2 md:mb-3">
<div className="w-8 h-8 md:w-10 md:h-10 rounded-xl bg-white/20 flex items-center justify-center">
<Wallet className="w-4 h-4 md:w-5 md:h-5" />
</div>
<TrendingUp className="w-3 h-3 md:w-4 md:h-4 opacity-75" />
</div>
<p className="text-xl md:text-2xl font-bold">
{(user.totalSpent / 1000000).toFixed(1)}M
</p>
<p className="text-[10px] md:text-sm opacity-80">
Jami xarajat
</p>
</CardContent>
</Card>
<Card className="border-0 shadow-sm">
<CardContent className="p-3 md:p-5">
<div className="flex items-center justify-between mb-2 md:mb-3">
<div className="w-8 h-8 md:w-10 md:h-10 rounded-xl bg-amber-100 flex items-center justify-center">
<Truck className="w-4 h-4 md:w-5 md:h-5 text-amber-600" />
</div>
</div>
<p className="text-xl md:text-2xl font-bold text-foreground">
{statistics.inTransit}
</p>
<p className="text-[10px] md:text-sm text-muted-foreground">
{"Yo'lda"}
</p>
</CardContent>
</Card>
<Card className="border-0 shadow-sm">
<CardContent className="p-3 md:p-5">
<div className="flex items-center justify-between mb-2 md:mb-3">
<div className="w-8 h-8 md:w-10 md:h-10 rounded-xl bg-emerald-100 flex items-center justify-center">
<CheckCircle className="w-4 h-4 md:w-5 md:h-5 text-emerald-600" />
</div>
</div>
<p className="text-xl md:text-2xl font-bold text-foreground">
{statistics.delivered}
</p>
<p className="text-[10px] md:text-sm text-muted-foreground">
Yetkazildi
</p>
</CardContent>
</Card>
</div>
{/* Active Orders Section */}
<div className="mb-6 md:mb-8">
<div className="flex items-center justify-between mb-3 md:mb-4">
@@ -194,7 +118,7 @@ const Profile = () => {
className="text-emerald-600 hover:text-emerald-700 h-8 text-xs md:text-sm"
onClick={() => setActiveSection('orders')}
>
Barchasi{' '}
Barchasi
<ChevronRight className="w-3 h-3 md:w-4 md:h-4 ml-1" />
</Button>
</div>
@@ -367,10 +291,11 @@ const Profile = () => {
{/* Desktop Sidebar - hidden on mobile */}
<div className="hidden md:block w-80 shrink-0">
<div className="flex items-center gap-4 mb-8">
<Avatar className="w-14 h-14 ring-2 ring-emerald-500 ring-offset-2">
<Avatar className="w-14 h-14 ring-2 ring-emerald-500 ring-offset-2 flex items-center justify-center">
<AvatarImage
src={user.avatar || '/placeholder.svg'}
alt={user.phone}
className="h-12 w-12"
/>
<AvatarFallback className="bg-emerald-500 text-white font-semibold">
U