@@ -2,7 +2,6 @@ import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle }
2
2
import { Button } from "@/components/ui/button" ;
3
3
import { Avatar , AvatarFallback , AvatarImage } from "@/components/ui/avatar" ;
4
4
import { Badge } from "@/components/ui/badge" ;
5
-
6
5
import {
7
6
priceToName ,
8
7
difficultyToName ,
@@ -11,10 +10,12 @@ import {
11
10
} from "../../pages/recipes/translateObjectToNames" ;
12
11
import Filters from "./Filters" ;
13
12
import { Separator } from "@/components/ui/separator" ;
13
+ import { Suspense } from "react" ;
14
+ import Loader from "../Loading.tsx" ;
14
15
15
16
export default function Recipes ( ) {
16
17
return (
17
- < >
18
+ < Suspense fallback = { < Loader /> } >
18
19
< h2 className = "mt-8 scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl" > Recipes</ h2 >
19
20
20
21
< Filters />
@@ -27,35 +28,119 @@ export default function Recipes() {
27
28
< CardHeader >
28
29
< div className = "flex flex-wrap gap-2" >
29
30
{ recipe . tolerance . includes ( 2 ) && (
30
- < Badge variant = "default" className = "w-fit" >
31
+ < Badge variant = "default" className = "w-fit gap-2" >
32
+ < svg
33
+ xmlns = "http://www.w3.org/2000/svg"
34
+ viewBox = "0 0 24 24"
35
+ strokeLinecap = "round"
36
+ strokeLinejoin = "round"
37
+ className = "lucide lucide-vegan w-4 fill-none stroke-current stroke-2"
38
+ >
39
+ < path d = "M2 2a26.6 26.6 0 0 1 10 20c.9-6.82 1.5-9.5 4-14" />
40
+ < path d = "M16 8c4 0 6-2 6-6-4 0-6 2-6 6" />
41
+ < path d = "M17.41 3.6a10 10 0 1 0 3 3" />
42
+ </ svg >
31
43
Vegan
32
44
</ Badge >
33
45
) }
34
46
{ recipe . tolerance . includes ( 1 ) && ! recipe . tolerance . includes ( 2 ) && (
35
- < Badge variant = "secondary" className = "w-fit" >
47
+ < Badge variant = "secondary" className = "w-fit gap-2" >
48
+ < svg
49
+ xmlns = "http://www.w3.org/2000/svg"
50
+ viewBox = "0 0 24 24"
51
+ strokeLinecap = "round"
52
+ strokeLinejoin = "round"
53
+ className = "lucide lucide-salad w-4 fill-none stroke-current stroke-2"
54
+ >
55
+ < path d = "M7 21h10" />
56
+ < path d = "M12 21a9 9 0 0 0 9-9H3a9 9 0 0 0 9 9Z" />
57
+ < path d = "M11.38 12a2.4 2.4 0 0 1-.4-4.77 2.4 2.4 0 0 1 3.2-2.77 2.4 2.4 0 0 1 3.47-.63 2.4 2.4 0 0 1 3.37 3.37 2.4 2.4 0 0 1-1.1 3.7 2.51 2.51 0 0 1 .03 1.1" />
58
+ < path d = "m13 12 4-4" />
59
+ < path d = "M10.9 7.25A3.99 3.99 0 0 0 4 10c0 .73.2 1.41.54 2" />
60
+ </ svg >
36
61
Vegeterian
37
62
</ Badge >
38
63
) }
39
64
{ ! recipe . tolerance . includes ( 1 ) && ! recipe . tolerance . includes ( 2 ) && (
40
- < Badge variant = "outline" className = "w-fit" >
65
+ < Badge variant = "outline" className = "w-fit gap-2" >
66
+ < svg
67
+ xmlns = "http://www.w3.org/2000/svg"
68
+ viewBox = "0 0 24 24"
69
+ strokeLinecap = "round"
70
+ strokeLinejoin = "round"
71
+ className = "lucide lucide-beef w-4 fill-none stroke-current stroke-2"
72
+ >
73
+ < circle cx = "12.5" cy = "8.5" r = "2.5" />
74
+ < path d = "M12.5 2a6.5 6.5 0 0 0-6.22 4.6c-1.1 3.13-.78 3.9-3.18 6.08A3 3 0 0 0 5 18c4 0 8.4-1.8 11.4-4.3A6.5 6.5 0 0 0 12.5 2Z" />
75
+ < path d = "m18.5 6 2.19 4.5a6.48 6.48 0 0 1 .31 2 6.49 6.49 0 0 1-2.6 5.2C15.4 20.2 11 22 7 22a3 3 0 0 1-2.68-1.66L2.4 16.5" />
76
+ </ svg >
41
77
Meat
42
78
</ Badge >
43
79
) }
44
80
45
81
{ recipe . price && (
46
- < Badge variant = "outline" className = "w-fit capitalize" >
82
+ < Badge
83
+ variant = "outline"
84
+ className = "w-fit gap-2 capitalize text-muted-foreground"
85
+ >
86
+ < svg
87
+ xmlns = "http://www.w3.org/2000/svg"
88
+ viewBox = "0 0 24 24"
89
+ strokeLinecap = "round"
90
+ strokeLinejoin = "round"
91
+ className = "lucide lucide-coins w-4 fill-none stroke-current stroke-2"
92
+ >
93
+ < circle cx = "8" cy = "8" r = "6" />
94
+ < path d = "M18.09 10.37A6 6 0 1 1 10.34 18" />
95
+ < path d = "M7 6h1v4" />
96
+ < path d = "m16.71 13.88.7.71-2.82 2.82" />
97
+ </ svg >
47
98
{ priceToName ( recipe . price ) }
48
99
</ Badge >
49
100
) }
50
101
51
102
{ recipe . difficulty && (
52
- < Badge variant = "outline" className = "w-fit capitalize" >
103
+ < Badge
104
+ variant = "outline"
105
+ className = "w-fit gap-2 capitalize text-muted-foreground"
106
+ >
107
+ < svg
108
+ xmlns = "http://www.w3.org/2000/svg"
109
+ viewBox = "0 0 24 24"
110
+ strokeLinecap = "round"
111
+ strokeLinejoin = "round"
112
+ className = "lucide lucide-construction w-4 fill-none stroke-current stroke-2"
113
+ >
114
+ < rect x = "2" y = "6" width = "20" height = "8" rx = "1" />
115
+ < path d = "M17 14v7" />
116
+ < path d = "M7 14v7" />
117
+ < path d = "M17 3v3" />
118
+ < path d = "M7 3v3" />
119
+ < path d = "M10 14 2.3 6.3" />
120
+ < path d = "m14 6 7.7 7.7" />
121
+ < path d = "m8 6 8 8" />
122
+ </ svg >
53
123
{ difficultyToName ( recipe . difficulty ) }
54
124
</ Badge >
55
125
) }
56
126
57
127
{ recipe . country && (
58
- < Badge variant = "outline" className = "w-fit uppercase" >
128
+ < Badge
129
+ variant = "outline"
130
+ className = "w-fit gap-2 uppercase text-muted-foreground"
131
+ >
132
+ < svg
133
+ xmlns = "http://www.w3.org/2000/svg"
134
+ viewBox = "0 0 24 24"
135
+ strokeLinecap = "round"
136
+ strokeLinejoin = "round"
137
+ className = "lucide lucide-globe-2 w-4 fill-none stroke-current stroke-2"
138
+ >
139
+ < path d = "M21.54 15H17a2 2 0 0 0-2 2v4.54" />
140
+ < path d = "M7 3.34V5a3 3 0 0 0 3 3v0a2 2 0 0 1 2 2v0c0 1.1.9 2 2 2v0a2 2 0 0 0 2-2v0c0-1.1.9-2 2-2h3.17" />
141
+ < path d = "M11 21.95V18a2 2 0 0 0-2-2v0a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05" />
142
+ < circle cx = "12" cy = "12" r = "10" />
143
+ </ svg >
59
144
{ recipe . country }
60
145
</ Badge >
61
146
) }
@@ -69,7 +154,7 @@ export default function Recipes() {
69
154
</ CardHeader >
70
155
< CardContent className = "grid gap-1" >
71
156
{ recipe . duration && (
72
- < div className = "flex gap-2" >
157
+ < div className = "flex items-center gap-2" >
73
158
< small className = "flex items-center gap-1 text-sm font-medium leading-none" >
74
159
< svg
75
160
xmlns = "http://www.w3.org/2000/svg"
@@ -165,7 +250,7 @@ export default function Recipes() {
165
250
) ;
166
251
} ) }
167
252
</ div >
168
- </ >
253
+ </ Suspense >
169
254
) ;
170
255
}
171
256
0 commit comments