carnet panel
This commit is contained in:
parent
b1988cef6d
commit
c64bacfee6
@ -1,12 +1,9 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { Search, BookOpen, Tag, Trash2, Star, Archive, X, Folder, FileText, Calendar, Heart, Users, LucideIcon, Layout, Plus } from 'lucide-react';
|
import { Search, BookOpen, Tag, Trash2, Star, Archive, X, Folder, FileText, Calendar, Heart, Users, LucideIcon, Plus } from 'lucide-react';
|
||||||
import { PaneLayout } from '@/app/carnet/page';
|
|
||||||
|
|
||||||
interface NavigationProps {
|
interface NavigationProps {
|
||||||
layout: string;
|
|
||||||
onLayoutChange: (layout: string) => void;
|
|
||||||
nextcloudFolders: string[];
|
nextcloudFolders: string[];
|
||||||
onFolderSelect: (folder: string) => void;
|
onFolderSelect: (folder: string) => void;
|
||||||
onNewNote: () => void;
|
onNewNote: () => void;
|
||||||
@ -27,7 +24,7 @@ const FOLDER_CONFIG: Record<FolderType, FolderConfig> = {
|
|||||||
'Contacts': { icon: Users, order: 4 }
|
'Contacts': { icon: Users, order: 4 }
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function Navigation({ layout, onLayoutChange, nextcloudFolders, onFolderSelect, onNewNote }: NavigationProps) {
|
export default function Navigation({ nextcloudFolders, onFolderSelect, onNewNote }: NavigationProps) {
|
||||||
const [searchQuery, setSearchQuery] = useState('');
|
const [searchQuery, setSearchQuery] = useState('');
|
||||||
|
|
||||||
const getFolderIcon = (folder: string) => {
|
const getFolderIcon = (folder: string) => {
|
||||||
@ -87,36 +84,6 @@ export default function Navigation({ layout, onLayoutChange, nextcloudFolders, o
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Layout Selection */}
|
|
||||||
<div className="p-4 border-b border-carnet-border">
|
|
||||||
<div className="flex items-center space-x-2">
|
|
||||||
<Layout className="h-4 w-4 text-carnet-text-muted" />
|
|
||||||
<span className="text-sm font-medium text-carnet-text-primary">Vues</span>
|
|
||||||
</div>
|
|
||||||
<div className="mt-2 space-y-1">
|
|
||||||
<button
|
|
||||||
onClick={() => onLayoutChange('item-selection')}
|
|
||||||
className={`w-full px-3 py-2 text-sm rounded-md ${
|
|
||||||
layout === 'item-selection'
|
|
||||||
? 'bg-primary text-white'
|
|
||||||
: 'text-carnet-text-primary hover:bg-carnet-hover'
|
|
||||||
}`}
|
|
||||||
>
|
|
||||||
Liste
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
onClick={() => onLayoutChange('table-view')}
|
|
||||||
className={`w-full px-3 py-2 text-sm rounded-md ${
|
|
||||||
layout === 'table-view'
|
|
||||||
? 'bg-primary text-white'
|
|
||||||
: 'text-carnet-text-primary hover:bg-carnet-hover'
|
|
||||||
}`}
|
|
||||||
>
|
|
||||||
Tableau
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Folders */}
|
{/* Folders */}
|
||||||
<div className="flex-1 overflow-y-auto p-4">
|
<div className="flex-1 overflow-y-auto p-4">
|
||||||
<div className="space-y-1">
|
<div className="space-y-1">
|
||||||
|
|||||||
@ -18,9 +18,10 @@ interface Note {
|
|||||||
interface NotesViewProps {
|
interface NotesViewProps {
|
||||||
onNoteSelect?: (note: Note) => void;
|
onNoteSelect?: (note: Note) => void;
|
||||||
currentFolder?: string;
|
currentFolder?: string;
|
||||||
|
onNewNote?: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const NotesView: React.FC<NotesViewProps> = ({ onNoteSelect, currentFolder = 'Notes' }) => {
|
export const NotesView: React.FC<NotesViewProps> = ({ onNoteSelect, currentFolder = 'Notes', onNewNote }) => {
|
||||||
const [searchQuery, setSearchQuery] = useState('');
|
const [searchQuery, setSearchQuery] = useState('');
|
||||||
const [notes, setNotes] = useState<Note[]>([]);
|
const [notes, setNotes] = useState<Note[]>([]);
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
@ -97,8 +98,17 @@ export const NotesView: React.FC<NotesViewProps> = ({ onNoteSelect, currentFolde
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col h-full bg-carnet-bg border-r border-carnet-border">
|
<div className="flex flex-col h-full bg-carnet-bg border-r border-carnet-border">
|
||||||
{/* Search Header */}
|
{/* Header with New Note Button */}
|
||||||
<div className="p-4 border-b border-carnet-border">
|
<div className="p-4 border-b border-carnet-border">
|
||||||
|
<div className="flex items-center justify-between mb-4">
|
||||||
|
<h2 className="text-lg font-semibold text-carnet-text-primary">{currentFolder}</h2>
|
||||||
|
<button
|
||||||
|
onClick={onNewNote}
|
||||||
|
className="p-2 text-carnet-text-primary hover:bg-carnet-hover rounded-md"
|
||||||
|
>
|
||||||
|
<Plus className="h-5 w-5" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
<div className="relative">
|
<div className="relative">
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user