diff --git a/app/components/Price.tsx b/app/components/Price.tsx new file mode 100644 index 0000000..3047a67 --- /dev/null +++ b/app/components/Price.tsx @@ -0,0 +1,29 @@ +import { PRICE } from "@prisma/client"; + +export default function Price({ price }: { price: PRICE }) { + const renderPrice = () => { + if (price === PRICE.CHEAP) { + return ( + <> + $$$$ + > + ); + } + if (price === PRICE.REGULAR) { + return ( + <> + $$$$ + > + ); + } + if (price === PRICE.EXPENSIVE) { + return ( + <> + $$$$ + > + ); + } + }; + + return
{renderPrice()}
; +} diff --git a/app/components/RestaurantCard.tsx b/app/components/RestaurantCard.tsx index 67bbf4a..a1d5119 100644 --- a/app/components/RestaurantCard.tsx +++ b/app/components/RestaurantCard.tsx @@ -1,5 +1,6 @@ import Link from "next/link"; import { RestaurantCardType } from "../page"; +import Price from "./Price"; interface Props { restaurant: RestaurantCardType; @@ -22,7 +23,7 @@ export default function RestaurantCard({restaurant}: Props) {{restaurant.cuisine.name}
-$$$$
+{restaurant.location.name}
Booked 3 times today