Minor fixes

This commit is contained in:
cracklesparkle
2024-07-05 18:00:31 +09:00
parent d298de0a72
commit c74c911eea
2 changed files with 50 additions and 22 deletions

View File

@ -22,6 +22,7 @@ interface DocumentProps {
const FileItemStyle: SxProps = {
cursor: 'pointer',
display: 'flex',
width: '100%',
flexDirection: 'row',
gap: '8px',
alignItems: 'center',
@ -46,16 +47,25 @@ function ItemFolder({ folder, index, handleFolderClick, ...props }: FolderProps)
function ItemDocument({ doc, index, handleDocumentClick, ...props }: DocumentProps) {
return (
<ListItemButton
onClick={() => handleDocumentClick(doc, index)}
>
<ListItemButton>
<Box
sx={FileItemStyle}
onClick={() => handleDocumentClick(doc, index)}
{...props}
>
<InsertDriveFile />
{doc.name}
</Box>
<Box>
<IconButton
onClick={() => {
console.log("TODO: save")
}}
sx={{ ml: 'auto' }}
>
<Download />
</IconButton>
</Box>
</ListItemButton>
)
}
@ -125,7 +135,7 @@ export default function FolderViewer() {
formData.append('files', file)
}
try {
// const response = await DocumentService.uploadFiles(currentFolder.id, formData, setUploadProgress);
const response = await DocumentService.uploadFiles(currentFolder.id, formData, setUploadProgress);
setIsUploading(false);
setFilesToUpload([]);
mutate(`/info/documents/${currentFolder.id}`);