/** * @license * SPDX-License-Identifier: Apache-2.0 */ import React, { useState, useMemo } from 'react'; import { Plus, Search, Share2, Archive, Settings, Lock, ChevronRight, MoreVertical, ArrowLeft, Sparkles, MessageSquare, Wand2, FileCode, Globe, Send, RefreshCw, Clock, BookOpen, Layout, Scissors, Zap, Languages, ArrowRightLeft, History } from 'lucide-react'; import { motion, AnimatePresence } from 'motion/react'; // --- Types --- type AITone = 'Professional' | 'Creative' | 'Academic' | 'Casual'; type AITab = 'discussion' | 'actions' | 'resources'; interface Note { id: string; carnetId: string; title: string; content: string; imageUrl: string; date: string; } interface Carnet { id: string; name: string; initial: string; type: 'Private' | 'Project' | 'Shared'; isPrivate?: boolean; } // --- Mock Data --- const CARNETS: Carnet[] = [ { id: '1', name: 'Daily Notes', initial: 'D', type: 'Private', isPrivate: true }, { id: '2', name: 'Project: Neo', initial: 'P', type: 'Project' }, { id: '3', name: 'Shared Docs', initial: 'S', type: 'Shared' }, { id: '4', name: 'Architecture Research', initial: 'A', type: 'Project' }, ]; const ALL_NOTES: Note[] = [ { id: 'n1', carnetId: '4', title: 'Grid Systems', date: 'Oct 26, 2024', content: 'Grid Systems is streathen in ognitiacs clesign and simulhere desipmalt: complded structurer and manamateriai-s: ci arevenuatingly used, asiller straterty of insaee to the tmn and usaes of disrension, architecture of emiornabious tracious structures.', imageUrl: 'https://images.unsplash.com/photo-1503387762-592dea58ef23?auto=format&fit=crop&q=80&w=800&h=600' }, { id: 'n2', carnetId: '4', title: 'Materiality', date: 'Oct 24, 2024', content: 'Materiality is combinated by relliaitic structureirs measure of plastics, natural, materials and priotical structures. Materialed coasts erabiocera alann light spaces and octicm employed design on thodolen of materiality, and tohlite tersev/ used in the gridin structures en obain materials, coms pathetic structure.', imageUrl: 'https://images.unsplash.com/photo-1486406146926-c627a92ad1ab?auto=format&fit=crop&q=80&w=800&h=600' }, { id: 'n3', carnetId: '4', title: 'Light & Space', date: 'Oct 22, 2024', content: 'Light & Space is a creaivity of light & Space inralicated in sizazant or dark crotrcning and netrescenations of avant trurme sivonpaltures for in inncr-en allimativefiting is cerriadating and sityle.', imageUrl: 'https://images.unsplash.com/photo-1497366216548-37526070297c?auto=format&fit=crop&q=80&w=800&h=600' }, { id: 'n4', carnetId: '2', title: 'Neo-Brutalism study', date: 'Sep 12, 2024', content: 'Exploring the raw aesthetic of neo-brutalism in urban environments. Focus on concrete textures and massive forms.', imageUrl: 'https://images.unsplash.com/photo-1518005020951-eccb494ad742?auto=format&fit=crop&q=80&w=800&h=600' } ]; // --- Components --- interface NoteLinkProps { note: Note; isActive: boolean; onClick: () => void; } const NoteLink: React.FC = ({ note, isActive, onClick }) => (
{note.title} ); interface SidebarItemProps { carnet: Carnet; isActive: boolean; notes: Note[]; activeNoteId: string | null; onCarnetClick: () => void; onNoteClick: (noteId: string) => void; } const SidebarItem: React.FC = ({ carnet, isActive, notes, activeNoteId, onCarnetClick, onNoteClick }) => { return (
{ onCarnetClick(); }} className={`w-full flex items-center gap-3 px-4 py-3 rounded-xl transition-all duration-300 group ${isActive ? 'active-nav-item' : 'hover:bg-white/40'}`} >
{carnet.initial}
{carnet.name} {carnet.isPrivate && }
{isActive && ( {notes.map(note => ( onNoteClick(note.id)} /> ))} {notes.length === 0 && (

No notes yet

)}
)}
); }; export default function App() { const [carnets, setCarnets] = useState(CARNETS); const [notes, setNotes] = useState(ALL_NOTES); const [activeCarnetId, setActiveCarnetId] = useState('4'); const [activeNoteId, setActiveNoteId] = useState(null); const [isAISidebarOpen, setIsAISidebarOpen] = useState(false); const [aiTab, setAiTab] = useState('discussion'); const [selectedTone, setSelectedTone] = useState('Professional'); // Modal States const [showNewCarnetModal, setShowNewCarnetModal] = useState(false); const [showNewNoteModal, setShowNewNoteModal] = useState(false); // Form States const [newCarnetName, setNewCarnetName] = useState(''); const [newNoteTitle, setNewNoteTitle] = useState(''); const [newNoteContent, setNewNoteContent] = useState(''); const filteredNotes = useMemo(() => notes.filter(n => n.carnetId === activeCarnetId), [activeCarnetId, notes]); const activeNote = useMemo(() => notes.find(n => n.id === activeNoteId), [activeNoteId, notes]); const activeCarnet = useMemo(() => carnets.find(c => c.id === activeCarnetId), [activeCarnetId, carnets]); const handleAddCarnet = (e: React.FormEvent) => { e.preventDefault(); if (!newCarnetName.trim()) return; const newCarnet: Carnet = { id: Date.now().toString(), name: newCarnetName, initial: newCarnetName.charAt(0).toUpperCase(), type: 'Project' }; setCarnets([...carnets, newCarnet]); setNewCarnetName(''); setShowNewCarnetModal(false); setActiveCarnetId(newCarnet.id); }; const handleAddNote = (e: React.FormEvent) => { e.preventDefault(); if (!newNoteTitle.trim() || !newNoteContent.trim()) return; const newNote: Note = { id: `n-${Date.now()}`, carnetId: activeCarnetId, title: newNoteTitle, date: new Intl.DateTimeFormat('en-US', { month: 'short', day: 'numeric', year: 'numeric' }).format(new Date()), content: newNoteContent, imageUrl: 'https://images.unsplash.com/photo-1487958449943-2429e8be8625?auto=format&fit=crop&q=80&w=800&h=600' }; setNotes([newNote, ...notes]); setNewNoteTitle(''); setNewNoteContent(''); setShowNewNoteModal(false); setActiveNoteId(newNote.id); }; return (
{!activeNoteId ? (

{activeCarnet?.name} — {filteredNotes[0]?.date || 'Oct 26'}

{filteredNotes.map((note, index) => ( setActiveNoteId(note.id)} >

{note.title}

{note.title}

{note.content}

Read more
))} {filteredNotes.length === 0 && (

This notebook is waiting for its first vision.

)}

© 2024 Architectural Grid. All rights reserved.

) : (
{activeCarnet?.name} {activeNote?.date}

{activeNote?.title}

{activeNote?.title}

{activeNote?.content.split('.')[0]}.

{activeNote?.content} {activeNote?.id.startsWith('n-') && ( <>

Architectural grids serve as the invisible scaffolding upon which spatial experiences are constructed. Beyond mere structural repetition, they facilitate a rhythmic dialogue between materiality and void. In this exploration, we examine how light fractures these rigid boundaries, creating a dynamic interplay that evolves with the passage of time. )}

{isAISidebarOpen && ( {/* Sidebar Header */}

IA Note

"{activeNote?.title}"

{/* Tabs Nav */}
{(['discussion', 'actions', 'resources'] as AITab[]).map((tab) => ( ))}
{/* Tab Content */}
{aiTab === 'discussion' && (

Posez une question à l'Assistant pour commencer.

Cette note
{(['Professional', 'Creative', 'Academic', 'Casual'] as AITone[]).map((tone) => ( ))}
)} {aiTab === 'actions' && (
{/* Transformations Section */}

Transformations

{[ { icon: , label: 'Clarifier' }, { icon: , label: 'Raccourcir' }, { icon: , label: 'Améliorer' }, { icon: , label: 'Traduire' }, ].map((action, i) => ( ))}
{/* Generation Section */}

Generation Tools

{/* Presentation Tool */}
Présentation

Convertir en slides interactives

Thème
Style
{/* Diagram Tool */}
Diagramme

Visualisation de structure

Type
Style
{/* Activity section placeholder */}
Auto-Save Enabled
)} {aiTab === 'resources' && (