first commit
This commit is contained in:
@@ -0,0 +1,96 @@
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { useAuth } from '@/hooks/useAuth';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { Home, User, MessageSquare, FileText } from 'lucide-react';
|
||||
|
||||
export default function MainPage() {
|
||||
const { user, isAuthenticated } = useAuth();
|
||||
const navigate = useNavigate();
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-gradient-to-br from-background to-muted p-4 pb-20">
|
||||
<div className="mx-auto max-w-sm">
|
||||
<div className="mb-6 text-center">
|
||||
<h1 className="text-2xl font-bold mb-2">خوش آمدید</h1>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
{isAuthenticated && user
|
||||
? `سلام ${user.email || user.phone || 'کاربر'}`
|
||||
: 'به اپلیکیشن پیشرفته PWA خوش آمدید'}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="grid gap-4 grid-cols-1">
|
||||
<Card className="cursor-pointer transition-all hover:shadow-lg" onClick={() => navigate('/account')}>
|
||||
<CardHeader>
|
||||
<User className="mb-2 h-7 w-7 text-primary" />
|
||||
<CardTitle className="text-lg">حساب کاربری</CardTitle>
|
||||
<CardDescription className="text-sm">مدیریت پروفایل و تنظیمات</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<Button variant="outline" className="w-full">
|
||||
مشاهده
|
||||
</Button>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
<Card className="cursor-pointer transition-all hover:shadow-lg" onClick={() => navigate('/request')}>
|
||||
<CardHeader>
|
||||
<FileText className="mb-2 h-7 w-7 text-primary" />
|
||||
<CardTitle className="text-lg">درخواستها</CardTitle>
|
||||
<CardDescription className="text-sm">ایجاد و مدیریت درخواستها</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<Button variant="outline" className="w-full">
|
||||
مشاهده
|
||||
</Button>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
<Card className="cursor-pointer transition-all hover:shadow-lg" onClick={() => navigate('/chat')}>
|
||||
<CardHeader>
|
||||
<MessageSquare className="mb-2 h-7 w-7 text-primary" />
|
||||
<CardTitle className="text-lg">چت</CardTitle>
|
||||
<CardDescription className="text-sm">ارسال پیام و ارتباط</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<Button variant="outline" className="w-full">
|
||||
مشاهده
|
||||
</Button>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
<Card className="mt-6">
|
||||
<CardHeader>
|
||||
<Home className="mb-2 h-7 w-7 text-primary" />
|
||||
<CardTitle className="text-lg">داشبورد اصلی</CardTitle>
|
||||
<CardDescription className="text-sm">نمای کلی از عملکرد سیستم</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="grid gap-3 grid-cols-1">
|
||||
<div className="rounded-lg border p-4">
|
||||
<div className="text-xl font-bold">0</div>
|
||||
<div className="text-xs text-muted-foreground">درخواستهای فعال</div>
|
||||
</div>
|
||||
<div className="rounded-lg border p-4">
|
||||
<div className="text-xl font-bold">0</div>
|
||||
<div className="text-xs text-muted-foreground">پیامهای جدید</div>
|
||||
</div>
|
||||
<div className="rounded-lg border p-4">
|
||||
<div className="text-xl font-bold">
|
||||
{isAuthenticated ? '✓' : '✗'}
|
||||
</div>
|
||||
<div className="text-xs text-muted-foreground">وضعیت ورود</div>
|
||||
</div>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user