import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; import { History, ToyBrick } from "lucide-react"; import Link from "next/link"; import { Button } from "@/components/ui/button"; import Image from "next/image"; import type { RentalHistoryEntry } from "@/types"; import { mockRentalHistory } from "@/lib/mockData"; import { getI18n } from "@/locales/server"; import type { Locale } from "@/locales/server"; import { Badge } from "@/components/ui/badge"; import { format } from 'date-fns'; const currentUserId = 1; // Assume this is the logged-in user's ID export default async function RentalHistoryPage({ params }: { params: { locale: Locale } }) { const t = await getI18n(); const locale = params.locale; // Filter rental history for the current user const userRentalHistory = mockRentalHistory.filter(entry => entry.userId === currentUserId); return (
{t('dashboard.rental_history.description')}
{t('rental_history_card.rented_from')}: {item.toy.ownerName}
{t('rental_history_card.rental_period')}: {formattedStartDate} - {formattedEndDate}
{t('rental_history_card.cost')}: ${item.totalCost.toFixed(2)}
{t('rental_history_card.status')}: {t(getStatusTextKey(item.status))}