Files
ui/src/features/edge-detail/components/EdgeTopbar.tsx
Первов Артем 31add10e56 decompose structure
2026-06-20 00:51:18 +03:00

47 lines
1.3 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { LogOut, Menu, RefreshCw } from 'lucide-react';
type EdgeTopbarProps = {
authEnabled: boolean;
currentEventsConnected: boolean;
edgeId: string;
onBack: () => void;
onLogout: () => void;
onRefresh: () => void;
};
export function EdgeTopbar({
authEnabled,
currentEventsConnected,
edgeId,
onBack,
onLogout,
onRefresh,
}: EdgeTopbarProps) {
return (
<header className="topbar">
<div>
<span className="page-kicker">Операторская панель</span>
<h1>Буровая установка {edgeId}</h1>
<span className={`current-transport current-transport--${currentEventsConnected ? 'sse' : 'polling'}`}>
{currentEventsConnected ? 'SSE live' : 'polling'}
</span>
</div>
<div className="topbar-actions">
<button type="button" className="ghost-button" onClick={onBack}>
<Menu size={17} />
К списку
</button>
<button type="button" className="icon-button" onClick={onRefresh} title="Обновить данные">
<RefreshCw size={18} />
</button>
{authEnabled ? (
<button type="button" className="ghost-button" onClick={onLogout}>
<LogOut size={17} />
Выйти
</button>
) : null}
</div>
</header>
);
}