-
Notifications
You must be signed in to change notification settings - Fork 293
Expand file tree
/
Copy pathHeaderButtons.tsx
More file actions
52 lines (45 loc) · 1.45 KB
/
HeaderButtons.tsx
File metadata and controls
52 lines (45 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import type { ReactElement, ReactNode } from 'react';
import React from 'react';
import LoginButton from '../LoginButton';
import NotificationsBell from '../notifications/NotificationsBell';
import ProfileButton from '../profile/ProfileButton';
import { useAuthContext } from '../../contexts/AuthContext';
import classed from '../../lib/classed';
import { useSettingsContext } from '../../contexts/SettingsContext';
import { OpportunityEntryButton } from '../opportunity/OpportunityEntryButton';
import { AgentStatusIndicator } from '../../features/agentStatus/components/AgentStatusIndicator';
interface HeaderButtonsProps {
additionalButtons?: ReactNode;
}
const Container = classed('div', 'ml-auto flex justify-end gap-3');
export function HeaderButtons({
additionalButtons,
}: HeaderButtonsProps): ReactElement {
const { isLoggedIn, isAuthReady } = useAuthContext();
const { loadedSettings } = useSettingsContext();
if (!isAuthReady || !loadedSettings) {
return <Container />;
}
if (!isLoggedIn) {
return (
<Container>
<LoginButton
className={{
container: 'gap-4',
button: 'hidden laptop:block',
}}
/>
</Container>
);
}
return (
<Container>
<OpportunityEntryButton />
<AgentStatusIndicator />
{additionalButtons}
<NotificationsBell />
<ProfileButton className="hidden laptop:flex" />
</Container>
);
}
export default HeaderButtons;