chore(save_indicator): prepare icon and title

This commit is contained in:
Elian Doran 2026-01-02 21:58:13 +02:00
parent e161ffce57
commit a1dda3b578
No known key found for this signature in database
2 changed files with 39 additions and 1 deletions

View File

@ -2209,7 +2209,11 @@
"execute_script": "Run script",
"execute_script_description": "This note is a script note. Click to execute the script.",
"execute_sql": "Run SQL",
"execute_sql_description": "This note is a SQL note. Click to execute the SQL query."
"execute_sql_description": "This note is a SQL note. Click to execute the SQL query.",
"save_status_saved": "Saved",
"save_status_saving": "Saving...",
"save_status_unsaved": "Unsaved",
"save_status_error": "Save failed"
},
"status_bar": {
"language_title": "Change content language",

View File

@ -12,6 +12,7 @@ import { useShareInfo } from "../shared_info";
export default function NoteBadges() {
return (
<div className="note-badges">
<SaveStatusBadge />
<ReadOnlyBadge />
<ShareBadge />
<ClippedNoteBadge />
@ -105,3 +106,36 @@ function ExecuteBadge() {
/>
);
}
function SaveStatusBadge() {
const state: "saved" | "saving" | "unsaved" | "error" = "saved"; // TODO: implement save state tracking
let icon: string;
let title: string;
switch (state) {
case "saved":
icon = "bx bx-check";
title = t("breadcrumb_badges.save_status_saved");
break;
case "saving":
icon = "bx bx-loader bx-spin";
title = t("breadcrumb_badges.save_status_saving");
break;
case "unsaved":
icon = "bx bx-cloud-upload";
title = t("breadcrumb_badges.save_status_unsaved");
break;
case "error":
icon = "bx bx-error-circle";
title = t("breadcrumb_badges.save_status_error");
break;
}
return (
<Badge
className="save-status-badge"
icon={icon}
text={title}
/>
);
}