45 lines
1.3 KiB
TypeScript
45 lines
1.3 KiB
TypeScript
import { Cuisine, PRICE, Location } from "@prisma/client";
|
|
import Link from "next/link";
|
|
import Price from "../../components/Price";
|
|
|
|
interface Restaurant {
|
|
cuisine: Cuisine;
|
|
name: string;
|
|
location: Location;
|
|
id: number;
|
|
price: PRICE;
|
|
main_image: string;
|
|
slug: string;
|
|
}
|
|
|
|
export default function RestaurantCard({restaurant}: {restaurant: Restaurant;} ) {
|
|
return (
|
|
<div className="border-b flex pb-5">
|
|
<Link href="/restaurant/milestones">
|
|
<img
|
|
src={restaurant.main_image}
|
|
alt=""
|
|
className="w-44 rounded"
|
|
/>
|
|
<div className="pl-5">
|
|
<h2 className="text-3xl">{restaurant.name}</h2>
|
|
<div className="flex items-start">
|
|
<div className="flex mb-2">*****</div>
|
|
<p className="ml-2 text-sm">Awesome</p>
|
|
</div>
|
|
<div className="mb-9">
|
|
<div className="font-light flex text-reg">
|
|
<Price price={restaurant.price} />
|
|
<p className="mr-4">{restaurant.cuisine.name}</p>
|
|
<p className="mr-4">{restaurant.location.name}</p>
|
|
</div>
|
|
</div>
|
|
<div className="text-red-600">
|
|
<Link href={`/restaurant/${restaurant.slug}`}>View more information</Link>
|
|
</div>
|
|
</div>
|
|
</Link>
|
|
</div>
|
|
);
|
|
}
|