import React from 'react'
import UploadDropzone from '../UploadDropzone'
import ScreenshotUploader from '../ScreenshotUploader'
/**
* Step1FileUpload
*
* Step 1 of the upload wizard: file selection + live upload progress.
* Shows the dropzone, optional screenshot uploader (archives),
* and the progress panel once an upload is in flight.
*/
export default function Step1FileUpload({
headingRef,
// File state
primaryFile,
primaryPreviewUrl,
primaryErrors,
primaryWarnings,
fileMetadata,
fileSelectionLocked,
onPrimaryFileChange,
// Archive screenshots
isArchive,
screenshots,
screenshotErrors,
screenshotPerFileErrors,
onScreenshotsChange,
// Machine state (passed for potential future use)
machine,
}) {
const fileSelected = Boolean(primaryFile)
return (
{/* ── Hero heading ─────────────────────────────────────────────────── */}
Step 1 of 3
Upload your artwork
Drop an image or an archive pack. We validate the file instantly so you can start uploading straight away.
{/* ── Locked notice ────────────────────────────────────────────────── */}
{fileSelectionLocked && (
File is locked after upload starts. Reset to change the file.
)}
{/* ── Primary dropzone ─────────────────────────────────────────────── */}
0}
errors={primaryErrors}
showLooksGood={fileSelected && primaryErrors.length === 0}
looksGoodText="File looks good — ready to upload"
locked={fileSelectionLocked}
onPrimaryFileChange={(file) => {
if (fileSelectionLocked) return
onPrimaryFileChange(file || null)
}}
/>
{/* ── Screenshots (archives only) ──────────────────────────────────── */}
0}
showLooksGood={isArchive && screenshots.length > 0 && screenshotErrors.length === 0}
looksGoodText="Screenshots look good"
onFilesChange={onScreenshotsChange}
/>
{/* ── Subtle what-happens-next hints (shown only before a file is picked) */}
{!fileSelected && (
{[
{
icon: (
),
label: 'Add your file',
hint: 'Image or archive — drop it in or click to browse.',
},
{
icon: (
),
label: 'Instant validation',
hint: 'Format, size, and screenshot checks run immediately.',
},
{
icon: (
),
label: 'Start upload',
hint: 'One click sends your file through the secure pipeline.',
},
].map((item) => (
))}
)}
)
}