'use client' import type { ConnectionState, PresenceUser } from '@/lib/collaboration/realtime' import PresenceAvatars from './PresenceAvatars' type ToolbarProps = { onAddDialogue: () => void onAddChoice: () => void onAddVariable: () => void onSave: () => void onExport: () => void onExportRenpy: () => void onImport: () => void onProjectSettings: () => void onShare: () => void connectionState?: ConnectionState presenceUsers?: PresenceUser[] } const connectionLabel: Record = { connecting: 'Connecting…', connected: 'Connected', disconnected: 'Disconnected', reconnecting: 'Reconnecting…', } const connectionColor: Record = { connecting: 'bg-yellow-400', connected: 'bg-green-400', disconnected: 'bg-red-400', reconnecting: 'bg-yellow-400', } export default function Toolbar({ onAddDialogue, onAddChoice, onAddVariable, onSave, onExport, onExportRenpy, onImport, onProjectSettings, onShare, connectionState, presenceUsers, }: ToolbarProps) { return (
Add Node:
{presenceUsers && presenceUsers.length > 0 && (
)} {connectionState && (
{connectionLabel[connectionState]}
)}
) }