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';
|
2024-02-15 02:30:10 +00:00
|
|
|
|
|
|
|
export const Navbar = () => {
|
2024-02-21 23:14:33 +00:00
|
|
|
const { userId } = auth();
|
|
|
|
|
|
|
|
let isSignedIn = !!userId;
|
|
|
|
|
2024-02-15 02:30:10 +00:00
|
|
|
return (
|
2024-02-16 01:49:19 +00:00
|
|
|
<div className='fixed top-0 flex h-14 w-full items-center border-b bg-white px-4 shadow-sm'>
|
|
|
|
<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-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>
|
|
|
|
<Link href='sign-in'>Login</Link>
|
|
|
|
</Button>
|
|
|
|
<Button size='sm' asChild>
|
|
|
|
<Link href='sign-up'>Get Tasko for Free</Link>
|
|
|
|
</Button>
|
|
|
|
</div>
|
|
|
|
) : (
|
|
|
|
<div>
|
|
|
|
<Button size='sm' variant='outline' asChild>
|
|
|
|
<Link href='/select-org'>Dashboard</Link>
|
|
|
|
</Button>
|
|
|
|
</div>
|
|
|
|
)}
|
2024-02-15 02:30:10 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|