create-web-kit 25.728.1414 → 25.728.1636

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,326 @@
1
+ "use client";
2
+ import { motion } from "motion/react";
3
+ import Link from "next/link";
4
+ import { Button } from "@/components/ui/button";
5
+
6
+ export default function ErrorPage({
7
+ error,
8
+ reset,
9
+ }: {
10
+ error: Error;
11
+ reset: () => void;
12
+ }) {
13
+ const springConfig = { type: "spring", damping: 10, stiffness: 100 };
14
+
15
+ return (
16
+ <div className="flex flex-col items-center justify-center min-h-screen bg-gray-50 px-4">
17
+ <title>Error </title>
18
+ <motion.h1
19
+ className="text-3xl font-bold text-gray-800 text-center"
20
+ initial={{ y: -50, opacity: 0 }}
21
+ animate={{ y: 0, opacity: 1 }}
22
+ transition={springConfig}
23
+ >
24
+ 出错了
25
+ </motion.h1>
26
+
27
+ <motion.p
28
+ className="text-gray-600 text-center"
29
+ initial={{ y: 50, opacity: 0 }}
30
+ animate={{ y: 0, opacity: 1 }}
31
+ transition={{ ...springConfig, delay: 0.1 }}
32
+ >
33
+ {error.message}
34
+ </motion.p>
35
+
36
+ <motion.div
37
+ initial={{ scale: 0.8, opacity: 0 }}
38
+ animate={{ scale: 1, opacity: 1 }}
39
+ transition={{ ...springConfig, delay: 0.2 }}
40
+ className="w-full max-w-sm mx-auto my-10"
41
+ >
42
+ <UnDrawError />
43
+ </motion.div>
44
+ <div className="flex gap-2">
45
+ <motion.div
46
+ initial={{ opacity: 0 }}
47
+ animate={{ opacity: 1 }}
48
+ transition={{ delay: 0.3, duration: 0.5 }}
49
+ >
50
+ <Button onClick={reset} variant="outline">
51
+ 重试
52
+ </Button>
53
+ </motion.div>
54
+ <motion.div
55
+ initial={{ opacity: 0 }}
56
+ animate={{ opacity: 1 }}
57
+ transition={{ delay: 0.4, duration: 0.5 }}
58
+ >
59
+ <Link href="/">
60
+ <Button>返回首页</Button>
61
+ </Link>
62
+ </motion.div>
63
+ </div>
64
+ </div>
65
+ );
66
+ }
67
+
68
+ function UnDrawError() {
69
+ return (
70
+ <motion.svg
71
+ animate={{
72
+ y: [0, -10, 0],
73
+ rotate: [0, -1, 1, 0],
74
+ }}
75
+ transition={{
76
+ duration: 5,
77
+ ease: "easeInOut",
78
+ times: [0, 0.2, 0.5, 0.8, 1],
79
+ repeat: Infinity,
80
+ repeatDelay: 1,
81
+ }}
82
+ className="w-full h-auto"
83
+ xmlns="http://www.w3.org/2000/svg"
84
+ data-name="Layer 1"
85
+ width="690"
86
+ height="448.7592"
87
+ viewBox="0 0 690 448.7592"
88
+ >
89
+ <path
90
+ d="M466.81292,645.7313c4.66847-10.08358,9.33339-20.31666,11.35946-31.24223s1.17569-22.78293-4.627-32.25932-17.22813-15.90241-28.13153-13.76022c-8.95532,1.75945-16.14605,8.81268-20.35651,16.90992S419.15759,602.60959,417.52,611.588c-.52917-10.2001-1.0896-20.56436-4.478-30.19975s-10.06045-18.61463-19.5694-22.34313-21.87886-.79648-26.89061,8.1032c-7.06074,12.53818,2.30155,30.12541-5.81734,42.0058-1.39265-11.917-13.85471-21.33234-25.69879-19.4159s-20.70109,14.78128-18.2646,26.5294c1.44978,6.99047,6.21931,12.93631,11.92156,17.232s12.33421,9.27436,18.89475,12.09Z"
91
+ transform="translate(-255 -225.6204)"
92
+ fill="#f2f2f2"
93
+ />
94
+ <path
95
+ d="M323.01987,598.15781c9.40825,3.28851,18.903,6.61425,27.49226,11.75558,7.698,4.60786,14.553,10.81187,18.88231,18.7569a33.35556,33.35556,0,0,1,4.12583,13.85861c.06251,1.01759,1.65458,1.02469,1.59164,0-.55661-9.061-4.97238-17.353-11.087-23.91075-6.704-7.18984-15.39158-12.10041-24.3611-15.91043-5.31821-2.259-10.76859-4.17895-16.2208-6.08468-.96887-.33866-1.3854,1.19842-.42311,1.53477Z"
96
+ transform="translate(-255 -225.6204)"
97
+ fill="#fff"
98
+ />
99
+ <path
100
+ d="M377.28745,560.62486a143.38254,143.38254,0,0,1,13.79113,30.61557,145.11672,145.11672,0,0,1,6.361,32.96846,143.30543,143.30543,0,0,1,.15151,18.83685c-.05905,1.02328,1.53278,1.01989,1.59163,0a145.1941,145.1941,0,0,0-2.04032-33.82049,146.92647,146.92647,0,0,0-9.769-32.44022,143.25,143.25,0,0,0-8.71162-16.9635.79641.79641,0,0,0-1.37432.80333Z"
101
+ transform="translate(-255 -225.6204)"
102
+ fill="#fff"
103
+ />
104
+ <path
105
+ d="M455.188,569.76743a232.04359,232.04359,0,0,0-17.11648,57.57847q-1.34225,8.36487-2.07791,16.81182c-.089,1.02023,1.50317,1.01426,1.59163,0a231.20919,231.20919,0,0,1,12.73788-58.02528q2.83382-7.89209,6.23921-15.56169c.412-.92791-.959-1.73862-1.37433-.80332Z"
106
+ transform="translate(-255 -225.6204)"
107
+ fill="#fff"
108
+ />
109
+ <rect
110
+ x="709.17625"
111
+ y="639.47815"
112
+ width="9.88235"
113
+ height="46.58824"
114
+ transform="translate(1112.59535 -285.4804) rotate(89.25872)"
115
+ fill="#e6e6e6"
116
+ />
117
+ <path
118
+ d="M754.02652,669.61624l-6.65257-.0194-4.11239-7.33712,4.445-7.31237,6.1811.01792a11.99893,11.99893,0,1,0,.13889,14.651Z"
119
+ transform="translate(-255 -225.6204)"
120
+ fill="#e6e6e6"
121
+ />
122
+ <path
123
+ d="M674.20833,669.61624l6.65258-.0194,4.11239-7.33712-4.445-7.31237-6.18109.01792a11.99892,11.99892,0,1,1-.1389,14.651Z"
124
+ transform="translate(-255 -225.6204)"
125
+ fill="#e6e6e6"
126
+ />
127
+ <path
128
+ d="M944,646.58958H256a1,1,0,0,1,0-2H944a1,1,0,0,1,0,2Z"
129
+ transform="translate(-255 -225.6204)"
130
+ fill="#3f3d56"
131
+ />
132
+ <circle cx="540.48622" cy="197.96918" r="33" fill="#2f2e41" />
133
+ <polygon
134
+ points="553.859 383.226 556.401 395.219 603.871 391.124 600.12 373.423 553.859 383.226"
135
+ fill="#ffb8b8"
136
+ />
137
+ <path
138
+ d="M789.18809,618.49673h38.53073a0,0,0,0,1,0,0v14.88687a0,0,0,0,1,0,0H804.07494a14.88685,14.88685,0,0,1-14.88685-14.88685v0A0,0,0,0,1,789.18809,618.49673Z"
139
+ transform="translate(108.71051 1320.97269) rotate(-101.96466)"
140
+ fill="#2f2e41"
141
+ />
142
+ <polygon
143
+ points="524.12 382.586 518.777 393.621 473.673 378.264 481.559 361.979 524.12 382.586"
144
+ fill="#ffb8b8"
145
+ />
146
+ <path
147
+ d="M771.03745,617.45562h23.64388a0,0,0,0,1,0,0v14.88687a0,0,0,0,1,0,0H756.15059a0,0,0,0,1,0,0v0A14.88685,14.88685,0,0,1,771.03745,617.45562Z"
148
+ transform="translate(-379.9408 824.86818) rotate(-64.16458)"
149
+ fill="#2f2e41"
150
+ />
151
+ <path
152
+ d="M690.25925,586.41362a10.74272,10.74272,0,0,0,12.70881-10.48016l74.37388-68.5711-18.47-14.30549-67.33743,71.94341a10.80091,10.80091,0,0,0-1.27527,21.41334Z"
153
+ transform="translate(-255 -225.6204)"
154
+ fill="#ffb8b8"
155
+ />
156
+ <circle cx="536.34449" cy="207.89831" r="24.56103" fill="#ffb8b8" />
157
+ <path
158
+ d="M813.38612,577.89329c-17.22851.00049-37.978-3.62842-50.77856-18.477l-.28833-.33447.29663-.32813c.09668-.10693,9.51367-10.86865.11084-30.061L749.799,532.67015,736.9286,515.68138l7.12964-21.38916,29.17749-23.50391a26.75074,26.75074,0,0,1,14.6106-5.78906,80.21058,80.21058,0,0,0,27.78467-7.91309,27.906,27.906,0,0,1,12.7998-2.79834l.57373.01611a9.95022,9.95022,0,0,1,9.64063,10.70752c-1.97852,25.62989-5.47242,87.54346,4.7915,108.86133l.26514.55078-.59229.15039A136.1132,136.1132,0,0,1,813.38612,577.89329Z"
159
+ transform="translate(-255 -225.6204)"
160
+ fill="#000000"
161
+ />
162
+ <path
163
+ d="M765.98622,559.08958s-65-6-72,13,1,28,13,32,41,9,41,9l13-16,34,2s37.88482,21.9732,48.35975,45.47377A30.76193,30.76193,0,0,0,869.12343,662.802c8.398.58447,15.86279-2.5874,15.86279-15.7124,0-30-42-73-42-73Z"
164
+ transform="translate(-255 -225.6204)"
165
+ fill="#2f2e41"
166
+ />
167
+ <path
168
+ d="M716.48622,588.58958s17-5,44,8"
169
+ transform="translate(-255 -225.6204)"
170
+ fill="#2f2e41"
171
+ />
172
+ <path
173
+ d="M766.84286,417.85547a73.04115,73.04115,0,0,0,31.59919,10.4119l-3.33084-3.991a24.4775,24.4775,0,0,0,7.5611,1.50142,8.28066,8.28066,0,0,0,6.74954-3.15917,7.70229,7.70229,0,0,0,.51556-7.115,14.58851,14.58851,0,0,0-4.58936-5.7385,27.32286,27.32286,0,0,0-25.43066-4.54493,16.32974,16.32974,0,0,0-7.59542,4.8722,9.23578,9.23578,0,0,0-1.86256,8.56086"
174
+ transform="translate(-255 -225.6204)"
175
+ fill="#2f2e41"
176
+ />
177
+ <path
178
+ d="M795.30911,398.22407A75.48468,75.48468,0,0,1,814.446,371.70269c5.292-4.70276,11.47246-8.74308,18.44626-9.9627s14.83309.86982,19.11055,6.51116c3.49772,4.613,4.15213,10.79276,3.76672,16.569s-1.67632,11.49651-1.5527,17.28428a35.46794,35.46794,0,0,0,50.52712,31.351c-6.02152,3.32885-10.714,8.59777-16.3048,12.60812s-12.96272,6.7601-19.31233,4.11012c-6.71812-2.80378-9.79963-10.41937-12.20607-17.28984L846.189,402.2443c-1.82434-5.20852-3.739-10.57156-7.462-14.6454s-9.76461-6.5568-14.88927-4.50871c-3.884,1.55225-6.41275,5.25755-8.63029,8.804s-4.557,7.31984-8.30359,9.17935-9.29837.7147-10.52292-3.28471"
179
+ transform="translate(-255 -225.6204)"
180
+ fill="#2f2e41"
181
+ />
182
+ <rect
183
+ x="802.91902"
184
+ y="543.31418"
185
+ width="9.88235"
186
+ height="46.58824"
187
+ transform="translate(-416.74744 524.13837) rotate(-45.74128)"
188
+ fill="#e6e6e6"
189
+ />
190
+ <path
191
+ d="M821.51005,579.90944a9.88235,9.88235,0,1,0,13.97459-.18081A9.88238,9.88238,0,0,0,821.51005,579.90944Zm10.111,9.8527a4.23529,4.23529,0,1,1-.07749-5.98911A4.2354,4.2354,0,0,1,831.62105,589.76214Z"
192
+ transform="translate(-255 -225.6204)"
193
+ fill="#e6e6e6"
194
+ />
195
+ <path
196
+ d="M784.47962,533.54889l4.69037,4.7178-2.28023,8.096-8.3137,2.02755-4.358-4.38337a11.99891,11.99891,0,1,0,10.26158-10.458Z"
197
+ transform="translate(-255 -225.6204)"
198
+ fill="#e6e6e6"
199
+ />
200
+ <path
201
+ d="M803.736,577.97923a11.579,11.579,0,0,1-1.26831-.07032,11.02341,11.02341,0,0,1-9.68018-9.68115,11.00337,11.00337,0,0,1,10.93115-12.25,10.62483,10.62483,0,0,1,1.46607.10938L838.76332,520.342l-3.50513-11.68457,17.605-7.8916,4.93384,12.06006a20.48972,20.48972,0,0,1-6.17724,23.67236l-36.96119,29.40088a10.25885,10.25885,0,0,1,.06006,1.07861,11.01824,11.01824,0,0,1-3.66382,8.19678A10.87186,10.87186,0,0,1,803.736,577.97923Z"
202
+ transform="translate(-255 -225.6204)"
203
+ fill="#ffb8b8"
204
+ />
205
+ <path
206
+ d="M829.98622,459.08958h0a9.45335,9.45335,0,0,1,12.628,5.1563l17.372,43.84371-27,18Z"
207
+ transform="translate(-255 -225.6204)"
208
+ fill="#000000"
209
+ />
210
+ <path
211
+ d="M703.48622,469.32728V250.8827a25.29812,25.29812,0,0,0-25.2623-25.2623H334.95386a25.29813,25.29813,0,0,0-25.2623,25.2623V469.32728a25.29813,25.29813,0,0,0,25.2623,25.2623H678.22392A25.29812,25.29812,0,0,0,703.48622,469.32728ZM334.95386,491.61754a22.31743,22.31743,0,0,1-22.29026-22.29026V250.8827a22.31744,22.31744,0,0,1,22.29026-22.29027H678.22392a22.31744,22.31744,0,0,1,22.29027,22.29027V469.32728a22.31744,22.31744,0,0,1-22.29027,22.29026Z"
212
+ transform="translate(-255 -225.6204)"
213
+ fill="#3f3d56"
214
+ />
215
+ <path
216
+ d="M700.51419,264.92368H312.6636a1.486,1.486,0,1,1,0-2.972H700.51419a1.486,1.486,0,0,1,0,2.972Z"
217
+ transform="translate(-255 -225.6204)"
218
+ fill="#3f3d56"
219
+ />
220
+ <circle cx="82.9259" cy="20.80425" r="7.43009" fill="#000000" />
221
+ <circle cx="108.1882" cy="20.80425" r="7.43009" fill="#000000" />
222
+ <circle cx="133.4505" cy="20.80425" r="7.43009" fill="#000000" />
223
+ <path
224
+ d="M443.97867,424.85206a.99974.99974,0,0,1-1-1c0-10.42675-4.5708-16.24218-11.94531-22.24707a.99992.99992,0,1,1,1.2627-1.55078c7.83007,6.375,12.68261,12.58008,12.68261,23.79785A.99973.99973,0,0,1,443.97867,424.85206Z"
225
+ transform="translate(-255 -225.6204)"
226
+ />
227
+ <path
228
+ d="M358.31656,424.85206a.99974.99974,0,0,1-1-1c0-11.21777,4.85254-17.42285,12.68262-23.79785a.99992.99992,0,1,1,1.2627,1.55078c-7.37452,6.00489-11.94532,11.82129-11.94532,22.24707A.99973.99973,0,0,1,358.31656,424.85206Z"
229
+ transform="translate(-255 -225.6204)"
230
+ />
231
+ <path
232
+ d="M435.41324,356.32179a1,1,0,0,1-.63183-1.77539c7.58056-6.17139,8.19726-14.93848,8.19726-24.92334a1,1,0,0,1,2,0c0,10.50488-.67236,19.74756-8.93457,26.47412A.99381.99381,0,0,1,435.41324,356.32179Z"
233
+ transform="translate(-255 -225.6204)"
234
+ />
235
+ <path
236
+ d="M366.88248,355.78663a.99383.99383,0,0,1-.63086-.22461c-8.26269-6.72705-8.93506-15.72705-8.93506-25.939a1,1,0,0,1,2,0c0,10.03662.60352,18.20557,8.19776,24.38818a1,1,0,0,1-.63184,1.77539Z"
237
+ transform="translate(-255 -225.6204)"
238
+ />
239
+ <path
240
+ d="M456.82828,377.77247H435.41276a1,1,0,0,1,0-2h21.41552a1,1,0,1,1,0,2Z"
241
+ transform="translate(-255 -225.6204)"
242
+ />
243
+ <path
244
+ d="M366.883,377.77247H345.46744a1,1,0,0,1,0-2H366.883a1,1,0,0,1,0,2Z"
245
+ transform="translate(-255 -225.6204)"
246
+ />
247
+ <path
248
+ d="M401.14762,420.56886a.99974.99974,0,0,1-1-1V351.03908a1,1,0,0,1,2,0v68.52978A.99974.99974,0,0,1,401.14762,420.56886Z"
249
+ transform="translate(-255 -225.6204)"
250
+ />
251
+ <path
252
+ d="M401.14762,420.56886A35.30522,35.30522,0,0,1,365.883,385.30372V359.58644c0-16.46826,13.5127-26.69873,35.26465-26.69873,22.74121,0,35.26514,9.48193,35.26514,26.69873v25.71728A35.30533,35.30533,0,0,1,401.14762,420.56886Zm0-85.68115c-16.08106,0-33.26465,6.48828-33.26465,24.69873v25.71728a33.2649,33.2649,0,1,0,66.52979,0V359.58644C434.41276,338.09669,413.571,334.88771,401.14762,334.88771Z"
253
+ transform="translate(-255 -225.6204)"
254
+ />
255
+ <path
256
+ d="M380.651,339.06154a1.0002,1.0002,0,0,1-.9292-.62989,14.08794,14.08794,0,0,1-.98828-4.53173A22.47566,22.47566,0,0,1,401.089,311.49074h.11475a22.46679,22.46679,0,0,1,22.35938,22.35693,12.22735,12.22735,0,0,1-.91016,4.21094,1,1,0,0,1-1.84961-.76075,10.19507,10.19507,0,0,0,.76074-3.4873,20.45407,20.45407,0,0,0-20.36279-20.31982h-.10986a20.46143,20.46143,0,0,0-20.35938,20.36181,12.07569,12.07569,0,0,0,.84717,3.83789,1.00121,1.00121,0,0,1-.92822,1.3711Z"
257
+ transform="translate(-255 -225.6204)"
258
+ />
259
+ <path
260
+ d="M502.71045,333.62308h-12a7,7,0,0,1,0-14h12a7,7,0,0,1,0,14Z"
261
+ transform="translate(-255 -225.6204)"
262
+ fill="#ccc"
263
+ />
264
+ <path
265
+ d="M584.71045,363.12308h-12a7,7,0,0,1,0-14h12a7,7,0,0,1,0,14Z"
266
+ transform="translate(-255 -225.6204)"
267
+ fill="#ccc"
268
+ />
269
+ <path
270
+ d="M622.71045,363.12308h-12a7,7,0,0,1,0-14h12a7,7,0,0,1,0,14Z"
271
+ transform="translate(-255 -225.6204)"
272
+ fill="#ccc"
273
+ />
274
+ <path
275
+ d="M660.71045,363.12308h-12a7,7,0,0,1,0-14h12a7,7,0,0,1,0,14Z"
276
+ transform="translate(-255 -225.6204)"
277
+ fill="#ccc"
278
+ />
279
+ <path
280
+ d="M585.71045,334.12308h-56a7,7,0,0,1,0-14h56a7,7,0,0,1,0,14Z"
281
+ transform="translate(-255 -225.6204)"
282
+ fill="#ccc"
283
+ />
284
+ <path
285
+ d="M546.71045,362.12308h-56a7,7,0,0,1,0-14h56a7,7,0,0,1,0,14Z"
286
+ transform="translate(-255 -225.6204)"
287
+ fill="#ccc"
288
+ />
289
+ <path
290
+ d="M656.71045,334.12308h-43a7,7,0,0,1,0-14h43a7,7,0,0,1,0,14Z"
291
+ transform="translate(-255 -225.6204)"
292
+ fill="#ccc"
293
+ />
294
+ <path
295
+ d="M502.71045,392.62308h-12a7,7,0,0,1,0-14h12a7,7,0,0,1,0,14Z"
296
+ transform="translate(-255 -225.6204)"
297
+ fill="#ccc"
298
+ />
299
+ <path
300
+ d="M585.71045,393.12308h-56a7,7,0,0,1,0-14h56a7,7,0,0,1,0,14Z"
301
+ transform="translate(-255 -225.6204)"
302
+ fill="#ccc"
303
+ />
304
+ <path
305
+ d="M656.71045,393.12308h-43a7,7,0,0,1,0-14h43a7,7,0,0,1,0,14Z"
306
+ transform="translate(-255 -225.6204)"
307
+ fill="#ccc"
308
+ />
309
+ <path
310
+ d="M637.71045,416.62308a7.00786,7.00786,0,0,1,7-7h12a7,7,0,0,1,0,14h-12A7.00785,7.00785,0,0,1,637.71045,416.62308Z"
311
+ transform="translate(-255 -225.6204)"
312
+ fill="#ccc"
313
+ />
314
+ <path
315
+ d="M554.71045,417.12308a7.00786,7.00786,0,0,1,7-7h56a7,7,0,0,1,0,14h-56A7.00785,7.00785,0,0,1,554.71045,417.12308Z"
316
+ transform="translate(-255 -225.6204)"
317
+ fill="#ccc"
318
+ />
319
+ <path
320
+ d="M483.71045,417.12308a7.00786,7.00786,0,0,1,7-7h43a7,7,0,0,1,0,14h-43A7.00785,7.00785,0,0,1,483.71045,417.12308Z"
321
+ transform="translate(-255 -225.6204)"
322
+ fill="#ccc"
323
+ />
324
+ </motion.svg>
325
+ );
326
+ }
@@ -0,0 +1,47 @@
1
+ import type { Metadata } from "next";
2
+ import { Inter } from "next/font/google";
3
+ import "./globals.css";
4
+ import { Providers } from "@/components/providers";
5
+
6
+ const inter = Inter({ subsets: ["latin"] });
7
+
8
+ export const metadata: Metadata = {
9
+ title: "Create Next App",
10
+ description: "Generated by create next app",
11
+ };
12
+
13
+ export default function RootLayout({
14
+ children,
15
+ }: {
16
+ children: React.ReactNode;
17
+ }) {
18
+ return (
19
+ <html lang="en" suppressHydrationWarning>
20
+ <head>
21
+ <meta httpEquiv="X-UA-Compatible" content="IE=edge,chrome=1" />
22
+ <meta name="renderer" content="webkit" />
23
+ <meta
24
+ name="viewport"
25
+ content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
26
+ />
27
+ {/* eslint-disable-next-line @next/next/no-before-interactive-script-outside-document */}
28
+ <script
29
+ dangerouslySetInnerHTML={{
30
+ __html: `
31
+ (function() {
32
+ var isIE = /MSIE|Trident/.test(navigator.userAgent);
33
+ var isOldIE = /MSIE [1-9]\\.|MSIE 10\\./.test(navigator.userAgent);
34
+ if (isOldIE) {
35
+ window.location.href = '/ie.html';
36
+ }
37
+ })();
38
+ `,
39
+ }}
40
+ />
41
+ </head>
42
+ <body className={inter.className} suppressHydrationWarning>
43
+ <Providers>{children}</Providers>
44
+ </body>
45
+ </html>
46
+ );
47
+ }
@@ -0,0 +1,16 @@
1
+ import Link from "next/link";
2
+
3
+ export default function NotFound() {
4
+ return (
5
+ <div className="flex min-h-screen flex-col items-center justify-center">
6
+ <h2 className="text-2xl font-bold">页面未找到</h2>
7
+ <p className="mt-4 text-gray-600">抱歉,您访问的页面不存在。</p>
8
+ <Link
9
+ href="/"
10
+ className="mt-6 rounded bg-blue-500 px-4 py-2 text-white hover:bg-blue-600"
11
+ >
12
+ 返回首页
13
+ </Link>
14
+ </div>
15
+ );
16
+ }
@@ -0,0 +1,20 @@
1
+ "use client";
2
+
3
+ import { useEffect } from "react";
4
+
5
+ import pkg from "../../package.json";
6
+
7
+ export default function BuildInfo() {
8
+ useEffect(() => {
9
+ const print = (key: string, value: string) =>
10
+ console.log(
11
+ `%c ${key} %c ${value} %c `,
12
+ "background:#20232a ; padding: 1px; border-radius: 3px 0 0 3px; color: #fff",
13
+ "background:#61dafb ;padding: 1px; border-radius: 0 3px 3px 0; color: #20232a; font-weight: bold;",
14
+ "background:transparent"
15
+ );
16
+ print(pkg.name, pkg.version);
17
+ print("build time", `${process.env.NEXT_PUBLIC_BUILD_TIME}`);
18
+ }, []);
19
+ return null;
20
+ }
@@ -0,0 +1,15 @@
1
+ import { ThemeProvider } from "./theme";
2
+ import { QueryProvider } from "./query";
3
+ import { Toaster } from "sonner";
4
+ import { TooltipProvider } from "@/components/ui/tooltip";
5
+
6
+ export function Providers({ children }: React.PropsWithChildren) {
7
+ return (
8
+ <QueryProvider>
9
+ <ThemeProvider>
10
+ <TooltipProvider>{children}</TooltipProvider>
11
+ <Toaster position="top-right" richColors />
12
+ </ThemeProvider>
13
+ </QueryProvider>
14
+ );
15
+ }
@@ -0,0 +1,45 @@
1
+ "use client";
2
+
3
+ import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
4
+ import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
5
+ import { useState } from "react";
6
+
7
+ export function QueryProvider({ children }: { children: React.ReactNode }) {
8
+ const [queryClient] = useState(
9
+ () =>
10
+ new QueryClient({
11
+ defaultOptions: {
12
+ queries: {
13
+ // 数据缓存时间 (默认 5 分钟)
14
+ staleTime: 5 * 60 * 1000,
15
+ // 数据在内存中的缓存时间 (默认 5 分钟)
16
+ gcTime: 5 * 60 * 1000,
17
+ // 重试次数
18
+ retry: 3,
19
+ // 重试延迟
20
+ retryDelay: (attemptIndex) =>
21
+ Math.min(1000 * 2 ** attemptIndex, 30000),
22
+ // 窗口重新获得焦点时是否重新获取数据
23
+ refetchOnWindowFocus: false,
24
+ // 网络重新连接时是否重新获取数据
25
+ refetchOnReconnect: true,
26
+ },
27
+ mutations: {
28
+ // 重试次数
29
+ retry: 1,
30
+ // 重试延迟
31
+ retryDelay: 1000,
32
+ },
33
+ },
34
+ })
35
+ );
36
+
37
+ return (
38
+ <QueryClientProvider client={queryClient}>
39
+ {children}
40
+ {/* {process.env.NODE_ENV === 'development' && (
41
+ <ReactQueryDevtools initialIsOpen={false} />
42
+ )} */}
43
+ </QueryClientProvider>
44
+ );
45
+ }
@@ -0,0 +1,17 @@
1
+ "use client";
2
+
3
+ import { ThemeProvider as NextThemesProvider } from "next-themes";
4
+ import * as React from "react";
5
+
6
+ export function ThemeProvider({ children }: React.PropsWithChildren) {
7
+ return (
8
+ <NextThemesProvider
9
+ attribute="class"
10
+ defaultTheme="system"
11
+ enableSystem
12
+ disableTransitionOnChange
13
+ >
14
+ {children}
15
+ </NextThemesProvider>
16
+ );
17
+ }
@@ -0,0 +1,12 @@
1
+ interface ShowProps {
2
+ when: boolean;
3
+ fallback?: React.ReactNode;
4
+ }
5
+
6
+ export default function Show({
7
+ children,
8
+ when,
9
+ fallback = null,
10
+ }: React.PropsWithChildren<ShowProps>) {
11
+ return when ? children : fallback;
12
+ }