import React, { useContext, useEffect } from 'react'; import { ServerContext } from '@/state/server'; import { CloudUploadIcon, XIcon } from '@heroicons/react/solid'; import asDialog from '@/hoc/asDialog'; import { Dialog, DialogWrapperContext } from '@/components/elements/dialog'; import { Button } from '@/components/elements/button/index'; import Tooltip from '@/components/elements/tooltip/Tooltip'; import Code from '@/components/elements/Code'; import { useSignal } from '@preact/signals-react'; const svgProps = { cx: 16, cy: 16, r: 14, strokeWidth: 3, fill: 'none', stroke: 'currentColor', }; const Spinner = ({ progress, className }: { progress: number; className?: string }) => ( ); const FileUploadList = () => { const { close } = useContext(DialogWrapperContext); const removeFileUpload = ServerContext.useStoreActions((actions) => actions.files.removeFileUpload); const clearFileUploads = ServerContext.useStoreActions((actions) => actions.files.clearFileUploads); const uploads = ServerContext.useStoreState((state) => Object.entries(state.files.uploads).sort(([a], [b]) => a.localeCompare(b)) ); return (
{name}