(e.preventDefault(), setDragOver(true))}
onDragLeave={() => setDragOver(false)}
onDrop={(e) => {
e.preventDefault();
setDragOver(false);
void upload(e.dataTransfer.files);
}}
>
{roots.length > 1 && (
)}
setSearch(e.target.value)} />
e.target.files && upload(e.target.files)} />
{crumbs.map((c, i) => {
const path = i === 0 ? c : `${crumbs[0]}/${crumbs.slice(1, i + 1).join("/")}`;
return (
{i > 0 && " / "}
(e.preventDefault(), load(path))}>
{i === 0 ? root?.name : c}
);
})}
{error &&
{error}
}
{hits ? (
hits.length === 0 ? (
{t("files.noHits")}
) : (
hits.map((h) => (
))
)
) : (
<>
{listing?.parent && (
)}
{listing?.entries.map((e) => {
const mark = gitMarks.get(e.path);
const active = pane.kind === "file" && pane.file.path === e.path;
return (
{e.is_dir && (
)}
{!e.is_dir && (
{t("files.download")}
)}
);
})}
{listing?.entries.length === 0 &&
{t("files.emptyFolder")}
}
>
)}
{t("files.dropHint")}
);
const right = (() => {
if (pane.kind === "diff") {
return (
{baseName(f.path)}
{dirty && }
{(isMd || isImage) && !f.preview && (
)}
{!f.binary && (
)}
{f.preview ? (
) : isImage && preview ? (
) : f.binary ? (
{f.tooLarge ? t("files.tooLarge") : t("files.binary")}
) : isMd && preview ? (
) : (
}>