import React, {useContext, useState} from "react"; import { CardContent, CardDescription, CardHeader, CardMeta, Container, Dropdown, Image, Input, PlaceholderHeader, PlaceholderLine, TableCell, TableRow } from "semantic-ui-react"; import { APIButton, BackButton, CardLink, cardTitleWrapper, encodeMediaPath, ExternalCardLink, FileIcon, findPosterPath, HelpHeader, humanFileSize, isoDatetimeToString, mimetypeColor, PageContainer, PreviewLink, PreviewPath, SearchInput, SortButton, TabLinks, textEllipsis, useTitle } from "./Common"; import {deleteArchives, postDownload, tagFileGroup, untagFileGroup} from "../api"; import {Link, Route, Routes, useNavigate, useParams} from "react-router-dom"; import Message from "semantic-ui-react/dist/commonjs/collections/Message"; import {useArchive, useDomains, useSearchArchives, useSearchDomain} from "../hooks/customHooks"; import {FileCards, FileRowTagIcon, FilesView} from "./Files"; import Grid from "semantic-ui-react/dist/commonjs/collections/Grid"; import _ from "lodash"; import {Media, ThemeContext} from "../contexts/contexts"; import {Button, Card, CardIcon, darkTheme, Header, Loader, Placeholder, Segment, Tab, TabPane} from "./Theme"; import {SortableTable} from "./SortableTable"; import {taggedImageLabel, TagsSelector} from "../Tags"; import {toast} from "react-semantic-toasts-2"; function archiveFileLink(path, directory = false) { if (path) { const href = directory ? `/media/${encodeMediaPath(path)}/` : `/media/${encodeMediaPath(path)}`; return
{path}
} else { return

Unknown

} } function ArchivePage() { const navigate = useNavigate(); const {archiveId} = useParams(); const {archiveFile, history, fetchArchive} = useArchive(archiveId); const {theme} = useContext(ThemeContext); let title; if (archiveFile && archiveFile.archive) { title = archiveFile.archive.title; } useTitle(title); if (archiveFile === null) { return ; } if (archiveFile === undefined) { return <>
Unknown archive
This archive does not exist
} const {data, size} = archiveFile; const singlefileUrl = data.singlefile_path ? `/media/${encodeMediaPath(data.singlefile_path)}` : null; const screenshotUrl = data.screenshot_path ? `/media/${encodeMediaPath(data.screenshot_path)}` : null; const singlefileButton = ; const {body, paginator, selectButton, viewButton, limitDropdown, tagQuerySelector} = FilesView( archives, activePage, totalPages, selectElm, selectedArchives, onSelect, setPage, !!searchStr, ); const searchInput = ; return <> {selectButton} {viewButton} {limitDropdown} {tagQuerySelector} {searchInput} {selectButton} {viewButton} {limitDropdown} {tagQuerySelector} {searchInput} {body} {paginator} } export function ArchiveRowCells({file}) { const {data} = file; const archiveUrl = `/archive/${data.id}`; const posterPath = findPosterPath(file); const posterUrl = posterPath ? `/media/${encodeMediaPath(posterPath)}` : null; let poster; if (posterUrl) { poster = ; } else { poster = ; } // Fragment for SelectableRow return
{poster}
{textEllipsis(file.title || file.stem)}
} export function ArchiveRoute() { const links = [ {text: 'Archives', to: '/archive', end: true}, {text: 'Domains', to: '/archive/domains'}, ]; return }/> }/> }/> }