feat: not uygulaması ve altyapısını ekle
- iOS Memos benzeri PWA ön yüz eklendi (React, Tailwind) - Express tabanlı arka uç, AnythingLLM API entegrasyonu ve senkronizasyon kuyruğu oluşturuldu - Docker, TypeScript ve proje konfigürasyonları tanımlandı
This commit is contained in:
37
frontend/src/components/editor/SyncBadge.tsx
Normal file
37
frontend/src/components/editor/SyncBadge.tsx
Normal file
@@ -0,0 +1,37 @@
|
||||
import { useNotesStore } from "../../store/notesStore";
|
||||
import type { NoteIndexItem } from "../../api/notesApi";
|
||||
import Button from "../ui/Button";
|
||||
|
||||
type SyncBadgeProps = {
|
||||
note?: NoteIndexItem;
|
||||
};
|
||||
|
||||
export default function SyncBadge({ note }: SyncBadgeProps) {
|
||||
if (!note) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (note.sync.status !== "synced" && note.sync.status !== "syncing") {
|
||||
return null;
|
||||
}
|
||||
|
||||
const statusLabel = note.sync.status === "synced" ? "Synced" : "Syncing";
|
||||
|
||||
return (
|
||||
<div className="flex items-center gap-2 text-xs">
|
||||
<span
|
||||
className={`rounded-full px-2 py-1 ${
|
||||
note.sync.status === "synced"
|
||||
? "bg-emerald-100 text-emerald-700"
|
||||
: note.sync.status === "syncing"
|
||||
? "bg-amber-100 text-amber-700"
|
||||
: note.sync.status === "error"
|
||||
? "bg-red-100 text-red-700"
|
||||
: "bg-slate-100 text-slate-600"
|
||||
}`}
|
||||
>
|
||||
{statusLabel}
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user