import { Signal } from "@preact/signals"; import Button from "@/components/Button.tsx"; import FileInfo from "@/components/FileInfo.tsx"; import { CloseIcon, DownloadIcon } from "@/components/Icons.tsx"; import { download_blob } from "@/src/files.ts"; export interface HubFile { id: string; name: string; size: number; uploaded_at: number; // TODO: replace with fetching and decrypting from the server once uploads exist blob: Blob; } const DATE_FORMAT = new Intl.DateTimeFormat(undefined, { dateStyle: "medium" }); interface HubFileListProps { files: Signal; } export default function HubFileList(props: HubFileListProps) { function remove(file: HubFile) { props.files.value = props.files.value.filter((other) => other.id !== file.id); } if (props.files.value.length === 0) { return (

Your files, encrypted

Only you can open what you store here. Add some files on the left to get started.

); } return (

Your files{" "} ({props.files.value.length})

); }