mirror of
https://github.com/R0m1k3/noteflow.git
synced 2026-10-16 11:48:19 +02:00
feat: highlight notes created via API with red background
- Add created_via column to notes table (values: 'web' or 'api') - Mark notes created via POST /api/notes/full as 'api' - Display light red background for API-created notes in dashboard - Add "API" badge with lightning icon for visual identification
This commit is contained in:
4 files changed
+24
-5
No files matched your search
+7
-1
@@ -1397,7 +1397,7 @@ const Index = () => {
|
||||
paginatedNotes.map(note => (
|
||||
<Card
|
||||
key={note.id}
|
||||
className="cursor-pointer hover:shadow-md transition-all group relative"
|
||||
className={`cursor-pointer hover:shadow-md transition-all group relative ${note.created_via === 'api' ? 'bg-red-50 dark:bg-red-950/30 border-red-200 dark:border-red-900' : ''}`}
|
||||
onClick={() => handleOpenNote(note)}
|
||||
>
|
||||
<CardContent className="p-4">
|
||||
@@ -1451,6 +1451,12 @@ const Index = () => {
|
||||
{note.content ? cleanHtmlContent(note.content) : "Note vide"}
|
||||
</p>
|
||||
<div className="flex gap-2 flex-wrap mb-2">
|
||||
{note.created_via === 'api' && (
|
||||
<Badge className="bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300 text-xs">
|
||||
<Zap className="h-3 w-3 mr-1" />
|
||||
API
|
||||
</Badge>
|
||||
)}
|
||||
{note.todos && note.todos.length > 0 && (
|
||||
<Badge variant="secondary">
|
||||
<CheckSquare className="h-3 w-3 mr-1" />
|
||||
|
||||
@@ -29,6 +29,7 @@ export interface Note {
|
||||
title: string;
|
||||
content: string;
|
||||
archived?: boolean;
|
||||
created_via?: 'web' | 'api';
|
||||
created_at?: string;
|
||||
updated_at?: string;
|
||||
todos: Todo[];
|
||||
|
||||
Reference in new issue
Block a user