mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-16 11:23:10 +02:00
Fix missing desktop save indicator on files (#6310)
# Description of Changes Save indicator stopped showing up after #6050, which fixed the missing truncation on filenames, but accidentally bypassed the save indicator component at the same time. This PR puts the component back in and makes it support truncation so we can have both. <img width="586" height="166" alt="image" src="https://github.com/user-attachments/assets/529c3dcb-ee00-4a6d-ae53-ef8657204369" />
This commit is contained in:
@@ -3,17 +3,22 @@ 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 }: FileEditorFileNameProps) => {
|
||||
const FileEditorFileName = ({
|
||||
file,
|
||||
maxLength = 40,
|
||||
}: FileEditorFileNameProps) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<>
|
||||
<PrivateContent>{file.name}</PrivateContent>
|
||||
<PrivateContent>{truncateCenter(file.name, maxLength)}</PrivateContent>
|
||||
{!file.localFilePath && (
|
||||
<Tooltip label={t("fileNotSavedToDisk", "Not saved to disk")}>
|
||||
<span
|
||||
|
||||
Reference in New Issue
Block a user