interstellar_ai/app/components/Header.tsx

44 lines
1.3 KiB
TypeScript
Raw Normal View History

2024-09-18 10:03:36 +02:00
// Header.tsx
import React from 'react';
2024-09-20 10:00:54 +02:00
import Login from './Login';
2024-09-18 10:03:36 +02:00
interface HeaderProps {
2024-09-19 09:54:00 +02:00
onViewChange: (view: 'AI' | 'FAQ' | 'Documentation') => void;
2024-09-19 12:18:04 +02:00
showDivs: boolean;
toggleDivs: () => void;
2024-09-19 09:54:00 +02:00
showHistoryModelsToggle: boolean;
2024-09-19 12:18:04 +02:00
showToggle: boolean; // Add this prop
2024-09-18 10:03:36 +02:00
}
2024-09-19 12:18:04 +02:00
const Header: React.FC<HeaderProps> = ({ onViewChange, showDivs, toggleDivs, showHistoryModelsToggle, showToggle }) => {
2024-09-18 10:03:36 +02:00
return (
2024-09-20 10:00:54 +02:00
<>
<header>
<ul>
2024-09-18 10:03:36 +02:00
<li>
2024-09-20 10:00:54 +02:00
<button onClick={() => onViewChange('AI')} className="header-button header-logo">
<img src="/img/logo.png" alt="logo" className="header-logo" />
2024-09-19 12:18:04 +02:00
</button>
2024-09-18 10:03:36 +02:00
</li>
2024-09-20 10:00:54 +02:00
<li>
<button onClick={() => onViewChange('FAQ')} className="header-button">FAQ</button>
</li>
<li>
<button onClick={() => onViewChange('Documentation')} className="header-button">Documentation</button>
</li>
{showToggle && showHistoryModelsToggle && (
<li>
<button onClick={toggleDivs} className="header-button">
{showDivs ? 'Hide History/Models' : 'Show History/Models'}
</button>
</li>
)}
</ul>
<Login />
</header>
</>
2024-09-18 10:03:36 +02:00
);
};
export default Header;