@nexusui/components
Version:
These are custom components specially-developed for NexusUI applications. They will make your life easier by giving you out-of-the-box implementations for various high-level UI elements that you can drop directly into your application.
2 lines (1 loc) • 1.42 kB
JavaScript
import{jsxs as t,jsx as e}from"react/jsx-runtime";import i from"@mui/material/Typography";import r from"@mui/material/Stack";import o from"@mui/material/Tooltip";import n from"@mui/icons-material/SubdirectoryArrowRightOutlined";import{FileUserCell as s}from"./FileUserCell.js";import{getHumanFileSize as a}from"../../../core/util/functions/index.js";import{getFileIcon as l}from"../utils/getFileIcon.js";import{FileAction as m}from"../models/index.js";const c="NexusFileNameCell",d=d=>{const{row:p,isMobile:u,onAction:f}=d,x=p.isFolder?"-":a(p.size,!0),y=l(p.name,p.isFolder,p.icon);return t(r,{"data-testid":`${c}-root`,justifyContent:"center",alignItems:"flex-start",spacing:2,sx:{mt:{xs:2.5,sm:0},mb:{xs:2.5,sm:0}},children:[t(r,{direction:"row",justifyContent:"center",alignItems:"center",spacing:2,sx:{cursor:p.isFolder?"pointer":"inherit"},children:[p.isSubFile&&e(n,{fontSize:"small",sx:{color:"grey.300"},"data-testid":`${c}-subIcon`}),y,e(o,{title:p.name,children:e(i,{"data-testid":`${c}-name`,variant:"body2",color:"text.secondary",noWrap:!0,onClick:()=>{p.isFolder&&f(p,m.Folder)},children:p.name})})]}),u&&t(r,{justifyContent:"center",alignItems:"flex-start",spacing:2,children:[e(s,{row:p}),e(i,{color:"text.secondary",variant:"body2","data-testid":`${c}-size`,children:x}),e(i,{color:"text.secondary",variant:"body2","data-testid":`${c}-time`,children:p.updatedTime})]})]})};export{d as FileNameCell};