FileListItem.tsx 359 Bytes
import React, { Fragment } from "react";
import { FileItem } from "./useFileList";
import { Link } from "react-router-dom";

export function FileListItem({ item }: { item: FileItem }) {
  return (
    <Fragment>
      {item.is_folder ? (
        <Link to={`/folder/${item.id}`}>{item.name}</Link>
      ) : (
        item.name
      )}
    </Fragment>
  );
}