2025-12-21 03:43:37 +02:00

42 lines
1.5 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import NotificationBell from "./NotificationBell";
function TopBar({ onAddClick, user, onLogout, onShowToast, onNotificationClick, onAdminClick }) {
return (
<header className="topbar">
<div className="topbar-left">
<span className="logo-emoji" role="img" aria-label="plate">
🍽
</span>
<div className="brand">
<div className="brand-title">מה לבשל היום?</div>
<div className="brand-subtitle">מנהל המתכונים האישי שלך</div>
</div>
</div>
<div className="topbar-actions">
{user && <NotificationBell onShowToast={onShowToast} onNotificationClick={onNotificationClick} />}
{user?.is_admin && (
<button className="btn ghost btn-mobile-compact" onClick={onAdminClick}>
<span className="btn-text-desktop">🛡 ניהול</span>
<span className="btn-text-mobile">🛡</span>
</button>
)}
{user && (
<button className="btn primary btn-mobile-compact" onClick={onAddClick}>
<span className="btn-text-desktop">+ מתכון חדש</span>
<span className="btn-text-mobile">+</span>
</button>
)}
{onLogout && (
<button className="btn ghost btn-mobile-compact" onClick={onLogout}>
<span className="btn-text-desktop">יציאה</span>
<span className="btn-text-mobile"></span>
</button>
)}
</div>
</header>
);
}
export default TopBar;