2024-02-21 23:14:33 +00:00
|
|
|
import Link from 'next/link';
|
2024-03-21 21:15:27 +00:00
|
|
|
import { auth } from '@clerk/nextjs/server';
|
2024-02-21 23:14:33 +00:00
|
|
|
|
2024-02-16 01:49:19 +00:00
|
|
|
import { Logo } from '@/components/logo';
|
|
|
|
import { Button } from '@/components/ui/button';
|
2025-01-14 00:12:06 +00:00
|
|
|
import { ModeToggle } from '@/components/ui/mode-toggle';
|
2024-02-15 02:30:10 +00:00
|
|
|
|
2024-10-23 23:17:45 +00:00
|
|
|
export const Navbar = async () => {
|
|
|
|
const { userId } = await auth();
|
2024-02-21 23:14:33 +00:00
|
|
|
|
|
|
|
let isSignedIn = !!userId;
|
|
|
|
|
2024-02-15 02:30:10 +00:00
|
|
|
return (
|
2025-01-14 00:12:06 +00:00
|
|
|
<nav className='fixed top-0 z-50 flex h-14 w-full items-center border-b bg-white px-4 shadow-sm dark:bg-black'>
|
2024-02-16 01:49:19 +00:00
|
|
|
<div className='mx-auto flex w-full items-center justify-between md:max-w-screen-2xl'>
|
2024-02-15 02:30:10 +00:00
|
|
|
<Logo />
|
2024-11-17 21:28:51 +00:00
|
|
|
<div className='ml-0 flex w-full flex-auto items-center space-x-1 md:ml-6 md:block md:w-auto md:space-x-4'>
|
|
|
|
<Button size='sm' variant='ghost' asChild>
|
|
|
|
<Link href='/blog'>Blog</Link>
|
|
|
|
</Button>
|
|
|
|
<Button size='sm' variant='ghost' asChild>
|
2024-12-08 19:21:54 +00:00
|
|
|
<Link href='https://docs.tasko.ahmadk953.org/'>Docs</Link>
|
2024-11-17 21:28:51 +00:00
|
|
|
</Button>
|
|
|
|
</div>
|
2024-02-16 01:49:19 +00:00
|
|
|
<div className='flex w-full items-center justify-between space-x-4 md:block md:w-auto'>
|
2024-02-21 23:14:33 +00:00
|
|
|
{!isSignedIn ? (
|
2024-02-25 01:16:11 +00:00
|
|
|
<div className='flex w-full justify-between space-x-4 md:block md:w-auto'>
|
2024-02-21 23:14:33 +00:00
|
|
|
<Button size='sm' variant='outline' asChild>
|
2024-11-17 21:28:51 +00:00
|
|
|
<Link href='/sign-in'>Login</Link>
|
2024-02-21 23:14:33 +00:00
|
|
|
</Button>
|
|
|
|
<Button size='sm' asChild>
|
2024-11-17 21:28:51 +00:00
|
|
|
<Link href='/sign-up'>Get Tasko for Free</Link>
|
2024-02-21 23:14:33 +00:00
|
|
|
</Button>
|
2025-01-14 00:12:06 +00:00
|
|
|
<ModeToggle />
|
2024-02-21 23:14:33 +00:00
|
|
|
</div>
|
|
|
|
) : (
|
2025-01-14 00:12:06 +00:00
|
|
|
<div className='flex w-full justify-between space-x-4 md:block md:w-auto'>
|
2024-02-21 23:14:33 +00:00
|
|
|
<Button size='sm' variant='outline' asChild>
|
|
|
|
<Link href='/select-org'>Dashboard</Link>
|
|
|
|
</Button>
|
2025-01-14 00:12:06 +00:00
|
|
|
<ModeToggle />
|
2024-02-21 23:14:33 +00:00
|
|
|
</div>
|
|
|
|
)}
|
2024-02-15 02:30:10 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2025-01-14 00:12:06 +00:00
|
|
|
</nav>
|
2024-02-15 02:30:10 +00:00
|
|
|
);
|
|
|
|
};
|