More emojis

This commit is contained in:
Andras Schmelczer 2025-01-03 15:10:12 +00:00
parent db21f70612
commit 9b7d37dd8a
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C

View file

@ -1,6 +1,6 @@
import type { WorkspaceLeaf } from "obsidian";
import { ItemView } from "obsidian";
import type { SyncHistory } from "src/tracing/sync-history";
import { SyncHistory, SyncType } from "src/tracing/sync-history";
import { SyncSource, SyncStatus } from "src/tracing/sync-history";
import { intlFormatDistance } from "date-fns";
import type { Database } from "src/database/database";
@ -24,6 +24,20 @@ export class HistoryView extends ItemView {
});
}
private static formatSyncType(type: SyncType | undefined): string {
switch (type) {
case SyncType.CREATE:
return "👶 ";
case SyncType.DELETE:
return "🗑️ ";
case SyncType.UPDATE:
return "✍️ ";
case undefined:
default:
return "";
}
}
private static formatSource(source: SyncSource | undefined): string {
switch (source) {
case SyncSource.PUSH:
@ -76,6 +90,7 @@ export class HistoryView extends ItemView {
const header = card.createDiv({ cls: "history-card-header" });
header.createEl("h5", {
text:
HistoryView.formatSyncType(entry.type) +
entry.relativePath +
HistoryView.formatSource(entry.source),
cls: "history-card-title",