Code
ts 46 lines 1.45 KB
Raw
1 import { notFound } from "next/navigation";
2 import { Product } from "./types";
3
4 export async function getProduct(id: string) {
5 const product = sampleProductsReviews[id] as Product;
6 if (!product) {
7 notFound();
8 }
9 return product;
10 }
11
12 export const sampleProductsReviews: Record<string, Product> = {
13 mower: {
14 name: "Hagersten StreetCut",
15 reviews: [
16 {
17 review:
18 "Fantastic barber! Got a sharp haircut and beard trim. The staff are friendly and really listen to what you want. The shop is clean and has a great vibe. Highly recommend if you're in Hagersten.",
19 authorName: "Erik S.",
20 date: "2024-05-15",
21 stars: 5,
22 },
23 {
24 review:
25 "Very professional service and attention to detail. I appreciated the advice on styling and products. Will definitely come back next month.",
26 authorName: "Anna L.",
27 date: "2024-04-28",
28 stars: 5,
29 },
30 {
31 review:
32 "Walked in without an appointment and was seen quickly. The barber was skilled and friendly. Prices are reasonable for Stockholm. Great local spot!",
33 authorName: "Jonas M.",
34 date: "2025-04-10",
35 stars: 4,
36 },
37 {
38 review:
39 "My son and I both got haircuts here. The barber was patient and did a great job with my son's hair. Convenient location in Hagersten.",
40 authorName: "Maria P.",
41 date: "2025-03-20",
42 stars: 5,
43 },
44 ],
45 },
46 };