Refactor media import components for improved layout and functionality
ci / build-backend (push) Successful in 1m31s
ci / build-frontend (push) Successful in 1m8s
ci / tests (push) Successful in 1m40s
ci / sonar (push) Successful in 4m34s

Updated the ManualInboxPanel, MediaImportDialog, MovieImportPanel, and UploadToShowPanel to enhance their layout and responsiveness. Adjusted flex properties to ensure consistent sizing and overflow handling across components. Simplified the MediaImportDialog by removing unnecessary file handling logic, and improved localization strings for clarity. These changes aim to enhance user experience and maintain a cohesive design across the media import interface.
This commit is contained in:
Leonid Pershin
2026-07-28 03:21:18 +03:00
parent f15b2fefcd
commit 05e9919a7b
7 changed files with 60 additions and 54 deletions
@@ -41,12 +41,9 @@ export function MediaPanel() {
const { t } = useTranslation()
const queryClient = useQueryClient()
const fileInput = useRef<HTMLInputElement>(null)
const fileInputShow = useRef<HTMLInputElement>(null)
const [filter, setFilter] = useState<MediaFilter>('active')
const [page, setPage] = useState(1)
const { sort, toggle } = useTableSort('created', true)
// Файлы, выбранные для загрузки в шоу: с ними окно импорта открывается сразу на нужной вкладке.
const [filesForShow, setFilesForShow] = useState<File[] | null>(null)
const [importOpen, setImportOpen] = useState(false)
const enqueue = useUploadStore((s) => s.enqueue)
@@ -170,21 +167,6 @@ export function MediaPanel() {
e.target.value = ''
}}
/>
<input
ref={fileInputShow}
type="file"
accept="video/*,.mkv,.avi,.ts"
multiple
className="hidden"
onChange={(e) => {
const files = e.target.files
if (files && files.length > 0) {
setFilesForShow(Array.from(files))
setImportOpen(true)
}
e.target.value = ''
}}
/>
<Button size="sm" variant="outline" onClick={() => setImportOpen(true)}>
<FolderInput className="h-4 w-4" />
{t('admin.media.importButton')}
@@ -196,15 +178,7 @@ export function MediaPanel() {
</div>
</div>
{importOpen && (
<MediaImportDialog
files={filesForShow}
onClose={() => {
setImportOpen(false)
setFilesForShow(null)
}}
/>
)}
{importOpen && <MediaImportDialog onClose={() => setImportOpen(false)} />}
<div className="crt-panel overflow-x-auto rounded-md">
<table className="w-full text-sm">