create-brainerce-store 1.65.0 → 1.67.0
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.
- package/dist/index.js +2 -2
- package/messages/en.json +505 -502
- package/messages/he.json +505 -502
- package/package.json +1 -1
- package/templates/nextjs/base/.env.local.ejs +45 -24
- package/templates/nextjs/base/.eslintrc.json +51 -57
- package/templates/nextjs/base/AGENTS.md.ejs +107 -81
- package/templates/nextjs/base/CLAUDE.md.ejs +118 -92
- package/templates/nextjs/base/next.config.ts +103 -86
- package/templates/nextjs/base/scripts/fetch-store-info.mjs +104 -97
- package/templates/nextjs/base/src/app/agents.md/route.ts +4 -3
- package/templates/nextjs/base/src/app/api/auth/me/route.ts +65 -59
- package/templates/nextjs/base/src/app/api/store/[...path]/route.ts +255 -242
- package/templates/nextjs/base/src/app/blog/[slug]/page.tsx.ejs +311 -308
- package/templates/nextjs/base/src/app/blog/page.tsx.ejs +277 -276
- package/templates/nextjs/base/src/app/blog/rss.xml/route.ts +4 -3
- package/templates/nextjs/base/src/app/category/[slug]/page.tsx +6 -5
- package/templates/nextjs/base/src/app/faq/page.tsx.ejs +46 -46
- package/templates/nextjs/base/src/app/indexnow-key.txt/route.ts +25 -26
- package/templates/nextjs/base/src/app/layout.tsx.ejs +273 -257
- package/templates/nextjs/base/src/app/llms.txt/route.ts +4 -3
- package/templates/nextjs/base/src/app/opengraph-image.tsx +1 -1
- package/templates/nextjs/base/src/app/page.tsx +65 -64
- package/templates/nextjs/base/src/app/pages/[slug]/page.tsx.ejs +92 -92
- package/templates/nextjs/base/src/app/products/[slug]/page.tsx +10 -5
- package/templates/nextjs/base/src/app/robots.ts +3 -2
- package/templates/nextjs/base/src/app/sitemap.ts +4 -3
- package/templates/nextjs/base/src/components/checkout/custom-fields-step.tsx +294 -292
- package/templates/nextjs/base/src/components/seo/article-json-ld.tsx +60 -59
- package/templates/nextjs/base/src/components/seo/category-json-ld.tsx +60 -61
- package/templates/nextjs/base/src/components/seo/product-json-ld.tsx +16 -2
- package/templates/nextjs/base/src/core/lib/brainerce.server.ts +81 -0
- package/templates/nextjs/base/src/core/lib/brainerce.ts.ejs +60 -110
- package/templates/nextjs/base/src/core/lib/site-url.ts +197 -0
- package/templates/nextjs/base/src/ui/product/faq-section.tsx.ejs +46 -0
- package/templates/nextjs/base/src/ui/product/review-form.tsx +294 -294
- package/templates/nextjs/base/src/ui/product/reviews-section.tsx.ejs +108 -108
- package/templates/nextjs/designs/atelier/app-overlay/layout.tsx.ejs +301 -285
- package/templates/nextjs/designs/atelier/ui/layout/faq-section.tsx +97 -96
- package/templates/nextjs/designs/atelier/ui/layout/site-footer.tsx.ejs +142 -141
- package/templates/nextjs/designs/atelier/ui/layout/site-header.tsx.ejs +139 -138
- package/templates/nextjs/designs/atelier/ui/product/review-form.tsx +295 -267
- package/templates/nextjs/designs/atelier/ui/product/reviews-section.tsx.ejs +148 -148
- package/templates/nextjs/ui-canvas/layout/faq-section.tsx.ejs +72 -71
- package/templates/nextjs/ui-canvas/layout/site-footer.tsx.ejs +83 -82
- package/templates/nextjs/ui-canvas/layout/site-header.tsx.ejs +120 -119
- package/templates/nextjs/ui-canvas/product/faq-section.tsx.ejs +54 -0
- package/templates/nextjs/ui-canvas/product/review-form.tsx +267 -266
- package/templates/nextjs/ui-canvas/product/reviews-section.tsx.ejs +96 -96
|
@@ -1,267 +1,295 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { useEffect, useState } from 'react';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
| { kind: '
|
|
17
|
-
| { kind: '
|
|
18
|
-
| { kind: '
|
|
19
|
-
| { kind: '
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
*
|
|
24
|
-
* -
|
|
25
|
-
* - Signed
|
|
26
|
-
* -
|
|
27
|
-
* - Eligible
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
if (
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
if (
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}: {
|
|
121
|
-
productId
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
<
|
|
244
|
-
{t('
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
</
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
}
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useEffect, useState } from 'react';
|
|
4
|
+
import { Link } from '@/core/lib/navigation';
|
|
5
|
+
import { getClient } from '@/core/lib/brainerce';
|
|
6
|
+
import { checkAuthStatus } from '@/core/lib/auth';
|
|
7
|
+
import { useTranslations } from '@/core/lib/translations';
|
|
8
|
+
import type { MyProductReview, ProductReview } from 'brainerce';
|
|
9
|
+
import { IconStar } from '@/ui/shared/icons';
|
|
10
|
+
|
|
11
|
+
interface ReviewFormProps {
|
|
12
|
+
productId: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
type Stage =
|
|
16
|
+
| { kind: 'loading' }
|
|
17
|
+
| { kind: 'signed_out' }
|
|
18
|
+
| { kind: 'not_eligible'; reason: MyProductReview['reason'] }
|
|
19
|
+
| { kind: 'submit' }
|
|
20
|
+
| { kind: 'edit'; review: ProductReview };
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Single component that decides which UI to render for a customer on a PDP:
|
|
24
|
+
* - Loading while we check auth state and eligibility
|
|
25
|
+
* - Signed out -> sign-in CTA
|
|
26
|
+
* - Signed in but not eligible -> "purchase this product to review"
|
|
27
|
+
* - Eligible without review -> submit form
|
|
28
|
+
* - Eligible with existing review -> edit/delete form (rating + body prefilled)
|
|
29
|
+
*
|
|
30
|
+
* DESIGN ME — review submit/edit form; auth via checkAuthStatus(), eligibility
|
|
31
|
+
* + existing review via getClient().getMyProductReview(productId).
|
|
32
|
+
*/
|
|
33
|
+
export function ReviewForm({ productId }: ReviewFormProps) {
|
|
34
|
+
const [stage, setStage] = useState<Stage>({ kind: 'loading' });
|
|
35
|
+
const t = useTranslations('reviews');
|
|
36
|
+
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
let cancelled = false;
|
|
39
|
+
async function load() {
|
|
40
|
+
const auth = await checkAuthStatus();
|
|
41
|
+
if (cancelled) return;
|
|
42
|
+
if (!auth.isLoggedIn) {
|
|
43
|
+
setStage({ kind: 'signed_out' });
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
try {
|
|
47
|
+
const me = await getClient().getMyProductReview(productId);
|
|
48
|
+
if (cancelled) return;
|
|
49
|
+
if (!me.eligible) {
|
|
50
|
+
setStage({ kind: 'not_eligible', reason: me.reason });
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
if (me.myReview) {
|
|
54
|
+
setStage({ kind: 'edit', review: me.myReview });
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
setStage({ kind: 'submit' });
|
|
58
|
+
} catch {
|
|
59
|
+
if (!cancelled) setStage({ kind: 'not_eligible', reason: 'product_not_found' });
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
void load();
|
|
63
|
+
return () => {
|
|
64
|
+
cancelled = true;
|
|
65
|
+
};
|
|
66
|
+
}, [productId]);
|
|
67
|
+
|
|
68
|
+
if (stage.kind === 'loading') {
|
|
69
|
+
return (
|
|
70
|
+
<p role="status" className="text-muted-foreground text-sm">
|
|
71
|
+
{t('loading')}
|
|
72
|
+
</p>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (stage.kind === 'signed_out') {
|
|
77
|
+
return (
|
|
78
|
+
<p className="text-muted-foreground text-sm">
|
|
79
|
+
<Link href="/login" className="text-primary font-semibold underline underline-offset-2">
|
|
80
|
+
{t('signIn')}
|
|
81
|
+
</Link>{' '}
|
|
82
|
+
{t('signInSuffix')}
|
|
83
|
+
</p>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (stage.kind === 'not_eligible') {
|
|
88
|
+
return <NotEligibleMessage reason={stage.reason} />;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (stage.kind === 'edit') {
|
|
92
|
+
return (
|
|
93
|
+
<EditReviewBlock
|
|
94
|
+
productId={productId}
|
|
95
|
+
initial={stage.review}
|
|
96
|
+
onDeleted={() => setStage({ kind: 'submit' })}
|
|
97
|
+
/>
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return <SubmitReviewBlock productId={productId} />;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function NotEligibleMessage({ reason }: { reason: MyProductReview['reason'] }) {
|
|
105
|
+
const t = useTranslations('reviews');
|
|
106
|
+
let message: string;
|
|
107
|
+
switch (reason) {
|
|
108
|
+
case 'no_eligible_order':
|
|
109
|
+
message = t('onlyPurchasers');
|
|
110
|
+
break;
|
|
111
|
+
case 'reviews_disabled':
|
|
112
|
+
message = t('reviewsDisabled');
|
|
113
|
+
break;
|
|
114
|
+
default:
|
|
115
|
+
message = t('cannotReview');
|
|
116
|
+
}
|
|
117
|
+
return <p className="text-muted-foreground text-sm">{message}</p>;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function SubmitReviewBlock({ productId }: { productId: string }) {
|
|
121
|
+
return <ReviewEditor productId={productId} mode="create" initialRating={5} initialBody="" />;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function EditReviewBlock({
|
|
125
|
+
productId,
|
|
126
|
+
initial,
|
|
127
|
+
onDeleted,
|
|
128
|
+
}: {
|
|
129
|
+
productId: string;
|
|
130
|
+
initial: ProductReview;
|
|
131
|
+
onDeleted: () => void;
|
|
132
|
+
}) {
|
|
133
|
+
const [deleting, setDeleting] = useState(false);
|
|
134
|
+
const t = useTranslations('reviews');
|
|
135
|
+
const [deleteError, setDeleteError] = useState<string | null>(null);
|
|
136
|
+
|
|
137
|
+
async function handleDelete() {
|
|
138
|
+
if (!window.confirm(t('confirmDelete'))) return;
|
|
139
|
+
setDeleting(true);
|
|
140
|
+
setDeleteError(null);
|
|
141
|
+
try {
|
|
142
|
+
await getClient().deleteMyProductReview(productId);
|
|
143
|
+
onDeleted();
|
|
144
|
+
window.location.reload();
|
|
145
|
+
} catch {
|
|
146
|
+
setDeleteError(t('deleteFailed'));
|
|
147
|
+
} finally {
|
|
148
|
+
setDeleting(false);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
return (
|
|
153
|
+
<div>
|
|
154
|
+
<ReviewEditor
|
|
155
|
+
productId={productId}
|
|
156
|
+
mode="edit"
|
|
157
|
+
initialRating={initial.rating}
|
|
158
|
+
initialBody={initial.body ?? ''}
|
|
159
|
+
/>
|
|
160
|
+
<div className="mt-4 flex flex-wrap items-center gap-2 border-t pt-4">
|
|
161
|
+
<p className="text-muted-foreground text-xs">{t('startOver')}</p>
|
|
162
|
+
<button
|
|
163
|
+
type="button"
|
|
164
|
+
onClick={handleDelete}
|
|
165
|
+
disabled={deleting}
|
|
166
|
+
className="text-destructive text-xs font-semibold underline underline-offset-2 disabled:opacity-50"
|
|
167
|
+
>
|
|
168
|
+
{deleting ? t('deleting') : t('deleteReview')}
|
|
169
|
+
</button>
|
|
170
|
+
</div>
|
|
171
|
+
{deleteError && (
|
|
172
|
+
<p role="alert" className="text-destructive mt-2 text-sm font-medium">
|
|
173
|
+
{deleteError}
|
|
174
|
+
</p>
|
|
175
|
+
)}
|
|
176
|
+
</div>
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* The actual form. Same shape for create and edit — only the API method
|
|
182
|
+
* and the heading differ. Optimistic UX: success state + page reload to
|
|
183
|
+
* let the server-rendered reviews list pick up the change.
|
|
184
|
+
*/
|
|
185
|
+
function ReviewEditor({
|
|
186
|
+
productId,
|
|
187
|
+
mode,
|
|
188
|
+
initialRating,
|
|
189
|
+
initialBody,
|
|
190
|
+
}: {
|
|
191
|
+
productId: string;
|
|
192
|
+
mode: 'create' | 'edit';
|
|
193
|
+
initialRating: number;
|
|
194
|
+
initialBody: string;
|
|
195
|
+
}) {
|
|
196
|
+
const [rating, setRating] = useState(initialRating);
|
|
197
|
+
const t = useTranslations('reviews');
|
|
198
|
+
const [body, setBody] = useState(initialBody);
|
|
199
|
+
const [submitting, setSubmitting] = useState(false);
|
|
200
|
+
const [error, setError] = useState<string | null>(null);
|
|
201
|
+
const [success, setSuccess] = useState(false);
|
|
202
|
+
|
|
203
|
+
async function handleSubmit(event: React.FormEvent<HTMLFormElement>) {
|
|
204
|
+
event.preventDefault();
|
|
205
|
+
setError(null);
|
|
206
|
+
setSubmitting(true);
|
|
207
|
+
try {
|
|
208
|
+
const client = getClient();
|
|
209
|
+
const input = { rating, body: body.trim() || undefined };
|
|
210
|
+
if (mode === 'edit') {
|
|
211
|
+
await client.updateMyProductReview(productId, input);
|
|
212
|
+
} else {
|
|
213
|
+
await client.submitProductReview(productId, input);
|
|
214
|
+
}
|
|
215
|
+
setSuccess(true);
|
|
216
|
+
setTimeout(() => window.location.reload(), 1200);
|
|
217
|
+
} catch (err) {
|
|
218
|
+
const status = (err as { status?: number })?.status;
|
|
219
|
+
if (status === 409) {
|
|
220
|
+
setError(t('alreadySubmitted'));
|
|
221
|
+
} else if (status === 403) {
|
|
222
|
+
setError(t('onlyPurchasers'));
|
|
223
|
+
} else if (status === 429) {
|
|
224
|
+
setError(t('tooMany'));
|
|
225
|
+
} else {
|
|
226
|
+
setError(mode === 'edit' ? t('updateFailed') : t('submitFailed'));
|
|
227
|
+
}
|
|
228
|
+
} finally {
|
|
229
|
+
setSubmitting(false);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
if (success) {
|
|
234
|
+
return (
|
|
235
|
+
<p role="status" className="text-primary text-sm font-semibold">
|
|
236
|
+
{mode === 'edit' ? t('thanksUpdated') : t('thanksSubmitted')}
|
|
237
|
+
</p>
|
|
238
|
+
);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
return (
|
|
242
|
+
<form onSubmit={handleSubmit} className="space-y-4">
|
|
243
|
+
<h3 className="font-sans text-base font-semibold">
|
|
244
|
+
{mode === 'edit' ? t('editYourReview') : t('writeReview')}
|
|
245
|
+
</h3>
|
|
246
|
+
|
|
247
|
+
<fieldset>
|
|
248
|
+
<legend className="mb-1.5 text-sm font-medium">{t('yourRating')}</legend>
|
|
249
|
+
<div className="inline-flex gap-1" role="radiogroup" aria-label={t('starRating')}>
|
|
250
|
+
{[1, 2, 3, 4, 5].map((n) => (
|
|
251
|
+
<button
|
|
252
|
+
key={n}
|
|
253
|
+
type="button"
|
|
254
|
+
role="radio"
|
|
255
|
+
aria-checked={rating === n}
|
|
256
|
+
onClick={() => setRating(n)}
|
|
257
|
+
className={n <= rating ? 'text-primary' : 'text-border hover:text-primary/50'}
|
|
258
|
+
>
|
|
259
|
+
<IconStar size={24} filled={n <= rating} />
|
|
260
|
+
<span className="sr-only">{n}</span>
|
|
261
|
+
</button>
|
|
262
|
+
))}
|
|
263
|
+
</div>
|
|
264
|
+
</fieldset>
|
|
265
|
+
|
|
266
|
+
<label className="block text-sm font-medium">
|
|
267
|
+
{t('yourReview')}{' '}
|
|
268
|
+
<span className="text-muted-foreground font-normal">({t('optionalField')})</span>
|
|
269
|
+
<textarea
|
|
270
|
+
value={body}
|
|
271
|
+
onChange={(event) => setBody(event.target.value)}
|
|
272
|
+
maxLength={5000}
|
|
273
|
+
rows={4}
|
|
274
|
+
className="input mt-1.5 h-auto min-h-24 py-2.5"
|
|
275
|
+
/>
|
|
276
|
+
</label>
|
|
277
|
+
|
|
278
|
+
{error && (
|
|
279
|
+
<p role="alert" className="text-destructive text-sm font-medium">
|
|
280
|
+
{error}
|
|
281
|
+
</p>
|
|
282
|
+
)}
|
|
283
|
+
|
|
284
|
+
<button type="submit" disabled={submitting} className="btn-primary btn-sm">
|
|
285
|
+
{submitting
|
|
286
|
+
? mode === 'edit'
|
|
287
|
+
? t('saving')
|
|
288
|
+
: t('submittingBtn')
|
|
289
|
+
: mode === 'edit'
|
|
290
|
+
? t('saveChanges')
|
|
291
|
+
: t('submitReview')}
|
|
292
|
+
</button>
|
|
293
|
+
</form>
|
|
294
|
+
);
|
|
295
|
+
}
|