{e.title}
{e.body}
import { useEffect, useState } from "react"; import { forgesight } from "@/lib/api"; import { toast } from "sonner"; import { Twitter, Linkedin, Copy, Plus, Sparkles } from "lucide-react"; export default function Journal() { const [items, setItems] = useState([]); const [title, setTitle] = useState(""); const [body, setBody] = useState(""); const [tags, setTags] = useState(""); const [busy, setBusy] = useState(false); const load = async () => { try { const data = await forgesight.listJournal(); setItems(data.items || []); if ((data.items || []).length === 0) { await forgesight.seedJournal(); const r = await forgesight.listJournal(); setItems(r.items || []); } } catch {} }; useEffect(() => { load(); }, []); const submit = async () => { if (!title.trim() || !body.trim()) { toast.error("Title + body required"); return; } setBusy(true); try { const data = await forgesight.createJournal({ title, body, tags: tags.split(",").map((t) => t.trim()).filter(Boolean), }); setItems((prev) => [data, ...prev]); setTitle(""); setBody(""); setTags(""); toast.success("Milestone logged + social drafts generated"); } catch (e) { toast.error(e?.response?.data?.detail || "Failed to log milestone"); } finally { setBusy(false); } }; const copy = async (text, label) => { try { await navigator.clipboard.writeText(text); toast.success(`${label} copied`); } catch { toast.error("Copy failed"); } }; return (
Every milestone auto-drafts social posts — X + LinkedIn — ready to ship, hashtags and AMD / lablab mentions baked in.
{e.body}