// Author: Simon-Pierre Boucher // Contact: contact@spboucher.ai // Project: chat.spboucher.ai "use client"; import { useRouter } from "next/navigation"; import type { ApiConversation } from "./types"; interface SidebarProps { conversations: ApiConversation[]; activeId: string | null; open: boolean; onSelect: (id: string) => void; onNew: () => void; onDelete: (id: string) => void; onClose: () => void; } export function Sidebar({ conversations, activeId, open, onSelect, onNew, onDelete, onClose }: SidebarProps) { const router = useRouter(); async function logout() { await fetch("/api/auth/logout", { method: "POST" }); router.replace("/login"); router.refresh(); } return ( <>
> ); }