import { useFiles } from "../../hooks/files"; import { useUtils } from "../../hooks/utils"; import React, { memo } from "react"; import FileItem from "../FileItem/FileItem"; import classNames from "classnames"; import { useAppDispatch, useAppSelector } from "../../hooks/store"; import { toggleListView } from "../../reducers/general"; const Files = memo(() => { const { data: files } = useFiles(false); const listView = useAppSelector((state) => state.general.listView); const { isHome } = useUtils(); const dispatch = useAppDispatch(); const changeListViewMode = () => { dispatch(toggleListView()); }; return (

{isHome ? "Home" : ""} Files

{!listView ? (
{files?.pages.map((filePage, index) => ( {filePage.map((file) => ( ))} ))}
) : ( {files?.pages.map((filePage, index) => ( {filePage.map((file) => ( ))} ))}

Name

Size

Created

Actions

)}
); }); export default Files;