deckhearth/src/pages/Dashboard.tsx

133 lines
4.6 KiB
TypeScript
Raw Normal View History

import React from 'react';
import { useAuth } from '../contexts/AuthContext';
import { Link } from 'react-router-dom';
const Dashboard: React.FC = () => {
const { user } = useAuth();
return (
<div>
<div className="mb-8">
<h1 className="text-3xl font-bold text-gray-900 mb-2">
Welcome back, {user?.username}!
</h1>
<p className="text-gray-600">
Here's an overview of your trading card collection.
</p>
</div>
{/* Quick Stats */}
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
<div className="bg-white rounded-lg shadow p-6 border border-gray-200">
<div className="flex items-center">
<div className="flex-shrink-0">
<span className="text-2xl">📚</span>
</div>
<div className="ml-4">
<p className="text-sm font-medium text-gray-600">Collections</p>
<p className="text-2xl font-bold text-gray-900">0</p>
</div>
</div>
</div>
<div className="bg-white rounded-lg shadow p-6 border border-gray-200">
<div className="flex items-center">
<div className="flex-shrink-0">
<span className="text-2xl">🎴</span>
</div>
<div className="ml-4">
<p className="text-sm font-medium text-gray-600">Decks</p>
<p className="text-2xl font-bold text-gray-900">0</p>
</div>
</div>
</div>
<div className="bg-white rounded-lg shadow p-6 border border-gray-200">
<div className="flex items-center">
<div className="flex-shrink-0">
<span className="text-2xl">🃏</span>
</div>
<div className="ml-4">
<p className="text-sm font-medium text-gray-600">Total Cards</p>
<p className="text-2xl font-bold text-gray-900">0</p>
</div>
</div>
</div>
<div className="bg-white rounded-lg shadow p-6 border border-gray-200">
<div className="flex items-center">
<div className="flex-shrink-0">
<span className="text-2xl">💰</span>
</div>
<div className="ml-4">
<p className="text-sm font-medium text-gray-600">Total Value</p>
<p className="text-2xl font-bold text-gray-900">$0</p>
</div>
</div>
</div>
</div>
{/* Quick Actions */}
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
<Link
to="/scanner"
className="bg-white rounded-lg shadow p-6 border border-gray-200 hover:shadow-md transition-shadow"
>
<div className="text-center">
<span className="text-4xl mb-4 block">📸</span>
<h3 className="text-lg font-semibold text-gray-900 mb-2">
Scan Cards
</h3>
<p className="text-gray-600">
Use OCR to quickly add cards to your collection
</p>
</div>
</Link>
<Link
to="/collections"
className="bg-white rounded-lg shadow p-6 border border-gray-200 hover:shadow-md transition-shadow"
>
<div className="text-center">
<span className="text-4xl mb-4 block">📚</span>
<h3 className="text-lg font-semibold text-gray-900 mb-2">
Manage Collections
</h3>
<p className="text-gray-600">
Organize and track your card collections
</p>
</div>
</Link>
<Link
to="/decks"
className="bg-white rounded-lg shadow p-6 border border-gray-200 hover:shadow-md transition-shadow"
>
<div className="text-center">
<span className="text-4xl mb-4 block">🎴</span>
<h3 className="text-lg font-semibold text-gray-900 mb-2">
Build Decks
</h3>
<p className="text-gray-600">
Create and optimize decks with AI assistance
</p>
</div>
</Link>
</div>
{/* Recent Activity (placeholder) */}
<div className="mt-8">
<h2 className="text-xl font-semibold text-gray-900 mb-4">
Recent Activity
</h2>
<div className="bg-white rounded-lg shadow border border-gray-200 p-6">
<p className="text-gray-500 text-center py-8">
No recent activity. Start by scanning some cards or creating a collection!
</p>
</div>
</div>
</div>
);
};
export default Dashboard;