mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-21 19:11:12 -05:00
feat: Add submitter fields to entity forms
This commit is contained in:
@@ -25,6 +25,8 @@ const rideModelSchema = z.object({
|
||||
category: z.string().min(1, 'Category is required'),
|
||||
ride_type: z.string().min(1, 'Ride type is required'),
|
||||
description: z.string().optional(),
|
||||
source_url: z.string().url().optional().or(z.literal('')),
|
||||
submission_notes: z.string().max(1000).optional().or(z.literal('')),
|
||||
images: z.object({
|
||||
uploaded: z.array(z.object({
|
||||
url: z.string(),
|
||||
@@ -92,6 +94,8 @@ export function RideModelForm({
|
||||
category: initialData?.category || '',
|
||||
ride_type: initialData?.ride_type || '',
|
||||
description: initialData?.description || '',
|
||||
source_url: initialData?.source_url || '',
|
||||
submission_notes: initialData?.submission_notes || '',
|
||||
images: initialData?.images || { uploaded: [] }
|
||||
}
|
||||
});
|
||||
@@ -214,6 +218,61 @@ export function RideModelForm({
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{/* Submission Context - For Reviewers */}
|
||||
<div className="space-y-4 border-t pt-6">
|
||||
<div className="flex items-center gap-2 mb-4">
|
||||
<Badge variant="secondary" className="text-xs">
|
||||
For Moderator Review
|
||||
</Badge>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
Help reviewers verify your submission
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="source_url" className="flex items-center gap-2">
|
||||
Source URL
|
||||
<span className="text-xs text-muted-foreground font-normal">
|
||||
(Optional)
|
||||
</span>
|
||||
</Label>
|
||||
<Input
|
||||
id="source_url"
|
||||
type="url"
|
||||
{...register('source_url')}
|
||||
placeholder="https://example.com/article"
|
||||
/>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
Where did you find this information? (e.g., official website, news article, press release)
|
||||
</p>
|
||||
{errors.source_url && (
|
||||
<p className="text-sm text-destructive">{errors.source_url.message}</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="submission_notes" className="flex items-center gap-2">
|
||||
Notes for Reviewers
|
||||
<span className="text-xs text-muted-foreground font-normal">
|
||||
(Optional)
|
||||
</span>
|
||||
</Label>
|
||||
<Textarea
|
||||
id="submission_notes"
|
||||
{...register('submission_notes')}
|
||||
placeholder="Add any context to help moderators verify this information (e.g., 'Confirmed via manufacturer catalog', 'Model specifications approximate')"
|
||||
rows={3}
|
||||
maxLength={1000}
|
||||
/>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
{watch('submission_notes')?.length || 0}/1000 characters
|
||||
</p>
|
||||
{errors.submission_notes && (
|
||||
<p className="text-sm text-destructive">{errors.submission_notes.message}</p>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Images */}
|
||||
<EntityMultiImageUploader
|
||||
mode={initialData ? 'edit' : 'create'}
|
||||
|
||||
Reference in New Issue
Block a user