отладка прикрепления файлов

This commit is contained in:
2026-06-17 22:07:52 +03:00
parent 043595beff
commit 9c4535e8c1
3 changed files with 34 additions and 26 deletions
+6 -4
View File
@@ -1,3 +1,4 @@
import { Paperclip } from "lucide-react";
import { useRef } from "react";
import { ApiError } from "../api/client";
@@ -81,15 +82,16 @@ export function MatchMedia({
))}
</div>
)}
{editable && (
{editable && !full && (
<>
<button
className="btn small"
style={{ marginTop: 8 }}
style={{ marginTop: 8, gap: 6 }}
onClick={() => fileRef.current?.click()}
disabled={pending || full}
disabled={pending}
>
{full ? `Максимум ${max} фото` : "Добавить фото"}
<Paperclip size={16} />
Прикрепить медиа
</button>
<input
ref={fileRef}
+8 -5
View File
@@ -201,11 +201,13 @@ export function MatchDetailPage() {
<div className="field">
<label className="label">Комментарий о партии</label>
<textarea rows={2} value={overall} onChange={(e) => setOverall(e.target.value)} />
</div>
<div className="field">
<label className="label">Фото партии (до 10)</label>
<textarea
rows={2}
style={{ resize: "none" }}
value={overall}
onChange={(e) => setOverall(e.target.value)}
/>
<div style={{ marginTop: 8 }}>
<MatchMedia
attachments={match.attachments}
editable
@@ -214,6 +216,7 @@ export function MatchDetailPage() {
pending={uploadAtt.isPending || deleteAtt.isPending}
/>
</div>
</div>
{error && <p className="error-text">{error}</p>}
+8 -5
View File
@@ -158,11 +158,13 @@ export function AdminMatchEdit({ matchId, onClose }: { matchId: number; onClose:
<div className="field">
<label className="label">Комментарий о партии</label>
<textarea rows={2} value={overall} onChange={(e) => setOverall(e.target.value)} />
</div>
<div className="field">
<label className="label">Медиа (до 10)</label>
<textarea
rows={2}
style={{ resize: "none" }}
value={overall}
onChange={(e) => setOverall(e.target.value)}
/>
<div style={{ marginTop: 8 }}>
<MatchMedia
attachments={attachments ?? []}
editable
@@ -171,6 +173,7 @@ export function AdminMatchEdit({ matchId, onClose }: { matchId: number; onClose:
pending={uploadAtt.isPending || deleteAtt.isPending}
/>
</div>
</div>
{error && <p className="error-text">{error}</p>}