"use client"; import { useState } from "react"; import { api } from "@/lib/client/fetcher"; import { Button, Dialog, Textarea, toast } from "../ui"; import { CATEGORIES } from "./memory-shared"; export function AddMemoryDialog({ open, onClose, onAdded, projectId }: { open: boolean; onClose: () => void; onAdded: () => void; projectId?: string | null }) { const [content, setContent] = useState(""); const [category, setCategory] = useState("context"); const [busy, setBusy] = useState(false); async function submit() { setBusy(true); try { await api("/api/memories", { method: "POST", json: { content: content.trim(), category, projectId: projectId ?? null } }); toast("Souvenir ajouté", "ok"); setContent(""); onAdded(); onClose(); } catch (e) { toast((e as Error).message, "error"); } finally { setBusy(false); } } return (

Un fait durable sur toi, tes projets ou ta façon de travailler. Jamais de mot de passe, de clé ni de donnée sensible.