feat: initial commit — backend API + student cabinet frontend
- Go backend: auth (JWT), points earn/spend, QR token generation, partners, admin grant/stats endpoints with chi router - Next.js 14 frontend: login, student dashboard, transaction history, QR display, partners list - PostgreSQL migrations (4 tables), Redis cache, Docker Compose - CORS middleware, role-based route protection, Zustand auth store Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
'use client';
|
||||
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { Card, Button } from '@/components/ui';
|
||||
import { formatPoints } from '@/lib/utils';
|
||||
|
||||
interface BalanceCardProps {
|
||||
balance: number;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export function BalanceCard({ balance, name }: BalanceCardProps) {
|
||||
const router = useRouter();
|
||||
|
||||
return (
|
||||
<Card className="bg-gradient-to-br from-blue-700 to-blue-900 text-white ring-0 shadow-lg">
|
||||
<p className="text-sm text-blue-200">{name}</p>
|
||||
<p className="mt-2 text-5xl font-bold tracking-tight">{formatPoints(balance)}</p>
|
||||
<p className="mt-1 text-sm text-blue-300">Доступно поинтов</p>
|
||||
<Button
|
||||
variant="secondary"
|
||||
className="mt-5 bg-white/10 text-white hover:bg-white/20 border border-white/20"
|
||||
onClick={() => router.push('/qr')}
|
||||
>
|
||||
Показать QR
|
||||
</Button>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user