I see this error with the app, reported by NextJS, please fix it. The er
This commit is contained in:
parent
396f1a76a1
commit
1e994e8a4c
|
|
@ -1,19 +1,28 @@
|
|||
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { ShoppingBag, ToyBrick } from "lucide-react";
|
||||
import Link from "next/link";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import Image from "next/image";
|
||||
import type { Toy } from "@/types";
|
||||
import { mockToys } from "@/lib/mockData";
|
||||
import { getAllToys } from "@/data/operations";
|
||||
import { getI18n } from "@/locales/server";
|
||||
|
||||
const rentedToys: (Toy & { rentalEndDate?: string, dataAiHint?: string })[] = [
|
||||
{ ...mockToys[1], rentalEndDate: "2024-08-15", dataAiHint: mockToys[1]?.category.toLowerCase() },
|
||||
{ ...mockToys[4], rentalEndDate: "2024-09-01", dataAiHint: mockToys[4]?.category.toLowerCase() },
|
||||
];
|
||||
|
||||
export default async function MyRentalsPage() {
|
||||
const t = await getI18n();
|
||||
const allToys = getAllToys();
|
||||
|
||||
// Mock data: toys rented by the current user
|
||||
// In a real app, this would come from a database query based on rental records
|
||||
const rentedToys: (Toy & { rentalEndDate?: string })[] = [];
|
||||
if (allToys.length > 1) {
|
||||
// Note: The ownerId here might not be the logged-in user, this is for demonstration.
|
||||
rentedToys.push({ ...allToys[1], rentalEndDate: "2024-12-15" });
|
||||
}
|
||||
if (allToys.length > 4) {
|
||||
rentedToys.push({ ...allToys[4], rentalEndDate: "2025-01-01" });
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
<div className="space-y-8">
|
||||
|
|
@ -50,7 +59,7 @@ export default async function MyRentalsPage() {
|
|||
}
|
||||
|
||||
interface RentalItemCardProps {
|
||||
toy: Toy & { rentalEndDate?: string, dataAiHint?: string };
|
||||
toy: Toy & { rentalEndDate?: string };
|
||||
t: (key: string, params?: Record<string, string | number>) => string;
|
||||
}
|
||||
|
||||
|
|
|
|||
BIN
toyshare.db-shm
BIN
toyshare.db-shm
Binary file not shown.
BIN
toyshare.db-wal
BIN
toyshare.db-wal
Binary file not shown.
Loading…
Reference in New Issue