-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDesktopActions.tsx
More file actions
64 lines (54 loc) · 1.56 KB
/
DesktopActions.tsx
File metadata and controls
64 lines (54 loc) · 1.56 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
53
54
55
56
57
58
59
60
61
62
63
64
'use client';
import { useTranslations } from 'next-intl';
import { LogIn, Settings, User } from 'lucide-react';
import { HeaderButton } from '@/components/shared/HeaderButton';
import { GitHubStarButton } from '@/components/shared/GitHubStarButton';
import LanguageSwitcher from '@/components/shared/LanguageSwitcher';
import { LogoutButton } from '@/components/auth/logoutButton';
import { CartButton } from '@/components/shop/header/CartButton';
import { BlogHeaderSearch } from '@/components/blog/BlogHeaderSearch';
type DesktopActionsProps = {
variant: 'platform' | 'shop' | 'blog';
userExists: boolean;
showAdminLink?: boolean;
};
export function DesktopActions({
variant,
userExists,
showAdminLink = false,
}: DesktopActionsProps) {
const t = useTranslations('navigation');
const isShop = variant === 'shop';
const isBlog = variant === 'blog';
return (
<div className="hidden items-center gap-2 lg:flex">
{userExists && (
<HeaderButton
variant="icon"
href="/dashboard"
icon={User}
label="Dashboard"
/>
)}
{showAdminLink && (
<HeaderButton
variant="icon"
href="/shop/admin"
icon={Settings}
label="Shop admin"
/>
)}
{isBlog && <BlogHeaderSearch />}
<LanguageSwitcher />
<GitHubStarButton />
{isShop && <CartButton />}
{!userExists ? (
<HeaderButton href="/login" icon={LogIn}>
{t('login')}
</HeaderButton>
) : (
<LogoutButton />
)}
</div>
);
}