import { useEffect, useState } from "react"; import type { DeckAccount } from "../types/app"; import { twitterClient } from "@/lib/client/twitterClient"; export interface NewAccountInput { cookie: string; } interface SidebarProps { accounts: DeckAccount[]; activeAccountId?: string; onActivate: (id: string) => void; onAddAccount: (payload: NewAccountInput) => void; onRemoveAccount: (id: string) => void; onAddColumn: () => void; } export function Sidebar({ accounts, activeAccountId, onActivate, onAddAccount, onRemoveAccount, onAddColumn, }: SidebarProps) { const [isAdding, setIsAdding] = useState(!accounts.length); const [cookie, setCookie] = useState(""); const [showCookie, setShowCookie] = useState(false); const handleSubmit = (event: React.FormEvent) => { event.preventDefault(); if (!cookie.trim()) return; onAddAccount({ cookie: decodeURIComponent(cookie.trim()) }); setCookie(""); setIsAdding(false); }; return (