link onwer toy list page to toy page owner's name

This commit is contained in:
Indigo Tang 2025-06-09 04:10:04 +00:00
parent 739eec3227
commit 362e8adf57
1 changed files with 6 additions and 3 deletions

View File

@ -1,3 +1,4 @@
import Image from 'next/image';
import { mockToys } from '@/lib/mockData';
import type { Toy } from '@/types';
@ -27,7 +28,7 @@ export default async function ToyPage({ params }: ToyPageProps) {
<div className="text-center py-12">
<h1 className="text-2xl font-bold mb-4">{t('toy_details.toy_not_found_title')}</h1>
<p className="text-muted-foreground mb-6">{t('toy_details.toy_not_found_description')}</p>
<Link href="/" passHref>
<Link href={`/${params.locale}/`} passHref>
<Button variant="outline">
<ArrowLeft className="mr-2 h-4 w-4" />
{t('toy_details.back_to_toys')}
@ -41,7 +42,7 @@ export default async function ToyPage({ params }: ToyPageProps) {
return (
<div className="container mx-auto py-8 px-4">
<Link href="/" className="inline-flex items-center text-primary hover:underline mb-6 group">
<Link href={`/${params.locale}/`} className="inline-flex items-center text-primary hover:underline mb-6 group">
<ArrowLeft className="mr-2 h-4 w-4 transition-transform group-hover:-translate-x-1" />
{t('toy_details.back_to_toys')}
</Link>
@ -90,7 +91,9 @@ export default async function ToyPage({ params }: ToyPageProps) {
<UserCircle2 className="h-5 w-5 mr-2 text-accent" />
<div>
<span className="font-medium text-muted-foreground">{t('toy_details.owner')}: </span>
<span className="text-foreground">{toy.ownerName}</span>
<Link href={`/${params.locale}/owner/${toy.ownerId}/toys`} className="text-foreground hover:underline">
{toy.ownerName}
</Link>
</div>
</div>
{toy.location && (