import React from "react"; import { Tooltip } from "@mantine/core"; import { useTranslation } from "react-i18next"; import { StirlingFileStub } from "@app/types/fileContext"; import { PrivateContent } from "@app/components/shared/PrivateContent"; import { truncateCenter } from "@app/utils/textUtils"; interface FileEditorFileNameProps { file: StirlingFileStub; maxLength?: number; } const FileEditorFileName = ({ file, maxLength = 40, }: FileEditorFileNameProps) => { const { t } = useTranslation(); return ( <> {truncateCenter(file.name, maxLength)} {!file.localFilePath && ( )} {file.localFilePath && file.isDirty && ( )} {file.localFilePath && !file.isDirty && ( )} ); }; export default FileEditorFileName;