improve profile
This commit is contained in:
@@ -240,37 +240,6 @@ function CelebrityProfile() {
|
|||||||
</div>
|
</div>
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
<details open>
|
|
||||||
<summary><h3>Galleria e Upload</h3></summary>
|
|
||||||
<div className="gallery-grid">
|
|
||||||
{celebrity.images.map(img => (
|
|
||||||
<div key={img.id} className="gallery-item">
|
|
||||||
<img src={`/api/uploads/${img.file_path}`} alt={`Immagine di ${celebrity.name}`} />
|
|
||||||
<div className="gallery-item-actions">
|
|
||||||
<button onClick={() => handleSetProfileImage(img.id)} disabled={celebrity.profile_image_id === img.id} title="Imposta come immagine profilo">Profilo</button>
|
|
||||||
<button onClick={() => handleDeleteImage(img.id)} className="secondary" title="Elimina immagine">X</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
<div className="upload-section">
|
|
||||||
<div>
|
|
||||||
<h4>Carica da File</h4>
|
|
||||||
<div className={`drop-zone ${isDraggingOver ? 'dragging-over' : ''}`} onClick={() => fileInputRef.current.click()} onDrop={handleDrop} onDragOver={handleDragOver} onDragEnter={handleDragEnter} onDragLeave={handleDragLeave} aria-busy={isUploading}>
|
|
||||||
<input type="file" ref={fileInputRef} onChange={handleFileChange} hidden multiple />
|
|
||||||
{isUploading ? <p>Caricamento di {selectedFiles.length} file...</p> : <p>Trascina i file qui, o <strong>clicca per selezionare</strong>.</p>}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<h4>Aggiungi da URL</h4>
|
|
||||||
<div className="grid">
|
|
||||||
<input type="url" placeholder="https://esempio.com/immagine.jpg" value={imageUrl} onChange={(e) => setImageUrl(e.target.value)} disabled={isFetchingFromUrl} />
|
|
||||||
<button onClick={handleFetchFromUrl} disabled={!imageUrl || isFetchingFromUrl} aria-busy={isFetchingFromUrl}>{isFetchingFromUrl ? '...' : 'Aggiungi'}</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</details>
|
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary><h3>Dati Anagrafici</h3></summary>
|
<summary><h3>Dati Anagrafici</h3></summary>
|
||||||
<div className="profile-grid">
|
<div className="profile-grid">
|
||||||
@@ -324,6 +293,37 @@ function CelebrityProfile() {
|
|||||||
<EditableField label="Note biografiche" name="biography" value={celebrity.biography} type="textarea" onSave={handleFieldSave} />
|
<EditableField label="Note biografiche" name="biography" value={celebrity.biography} type="textarea" onSave={handleFieldSave} />
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
<details open>
|
||||||
|
<summary><h3>Galleria e Upload</h3></summary>
|
||||||
|
<div className="gallery-grid">
|
||||||
|
{celebrity.images.map(img => (
|
||||||
|
<div key={img.id} className="gallery-item">
|
||||||
|
<img src={`/api/uploads/${img.file_path}`} alt={`Immagine di ${celebrity.name}`} />
|
||||||
|
<div className="gallery-item-actions">
|
||||||
|
<button onClick={() => handleSetProfileImage(img.id)} disabled={celebrity.profile_image_id === img.id} title="Imposta come immagine profilo">Profilo</button>
|
||||||
|
<button onClick={() => handleDeleteImage(img.id)} className="secondary" title="Elimina immagine">X</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
<div className="upload-section">
|
||||||
|
<div>
|
||||||
|
<h4>Carica da File</h4>
|
||||||
|
<div className={`drop-zone ${isDraggingOver ? 'dragging-over' : ''}`} onClick={() => fileInputRef.current.click()} onDrop={handleDrop} onDragOver={handleDragOver} onDragEnter={handleDragEnter} onDragLeave={handleDragLeave} aria-busy={isUploading}>
|
||||||
|
<input type="file" ref={fileInputRef} onChange={handleFileChange} hidden multiple />
|
||||||
|
{isUploading ? <p>Caricamento di {selectedFiles.length} file...</p> : <p>Trascina i file qui, o <strong>clicca per selezionare</strong>.</p>}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<h4>Aggiungi da URL</h4>
|
||||||
|
<div className="grid">
|
||||||
|
<input type="url" placeholder="https://esempio.com/immagine.jpg" value={imageUrl} onChange={(e) => setImageUrl(e.target.value)} disabled={isFetchingFromUrl} />
|
||||||
|
<button onClick={handleFetchFromUrl} disabled={!imageUrl || isFetchingFromUrl} aria-busy={isFetchingFromUrl}>{isFetchingFromUrl ? '...' : 'Aggiungi'}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</details>
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user