'use client';
import { ArrowUpRight, Clock, CreditCard, LogOut, User } from 'lucide-react';
import { useFetchMyBonusInfoQuery } from '@/entities/bonus/api/bonus.api';
import { useTextController } from '@/shared/language/hooks/use-text-controller';
import { Button } from '@/shared/shadcn-ui/button';
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from '@/shared/shadcn-ui/card';
import { TransactionsTable } from '@/widgets/transactions-table';
export function CustomerDashboard() {
const { t } = useTextController();
const { data, isLoading } = useFetchMyBonusInfoQuery({});
return (
{t('customer.pageTitle')}
{!data || isLoading ? (
// TODO: Bunyod please add loader here
<>Loader here>
) : (
<>
{t('customer.bonusCard.title')}
{t('customer.bonusCard.description')}
{data.bonuses}
{t('customer.bonusCard.points')}
{t('customer.bonusCard.validUntil')}{' '}
{new Date(data.end_date).toLocaleDateString('en-GB')}
>
)}
{/* Bonus Card */}
{/* Customer Card */}
{t('customer.infoCard.title')}
{!data || isLoading ? (
// TODO: Bunyod please add loader here
<>Loader here>
) : (
{t('customer.infoCard.regDateLabel')}
{data.fullname}
{t('customer.infoCard.regDateLabel')}
{new Date(data.reg_date).toLocaleDateString('en-GB')}
{t('customer.infoCard.cardNumberLabel')}
{data.cardno}
)}
);
}