'use client'
import {
ClerkLoaded,
ClerkLoading,
SignInButton,
SignedIn,
SignedOut,
UserButton,
useAuth,
} from '@clerk/nextjs';
import { Loader } from 'lucide-react';
import Image from 'next/image';
import Link from 'next/link';
import { Button } from '@/components/ui/button';
// import { links } from '@/config';
export const Header = () => {
const { userId } = useAuth();
return (
<header className='h-20 w-full border-b-2 border-slate-200 px-4'>
<div className='mx-auto flex h-full items-center justify-between lg:max-w-screen-lg'>
<Link href='/' className='flex items-center gap-x-3 pb-7 pl-4 pt-8'>
<Image src='/mascot.svg' alt='Mascot' height={40} width={40} />
<h1 className='text-2xl font-extrabold tracking-wide text-green-600'>
Lingo
</h1>
</Link>
<div className='flex gap-x-3'>
<ClerkLoading>
<Loader className='h-5 w-5 animate-spin text-muted-foreground' />
</ClerkLoading>
<ClerkLoaded>
<SignedIn>
<UserButton afterSignOutUrl='/' />
</SignedIn>
<SignedOut>
<SignInButton
mode='modal'
afterSignInUrl='/learn'
afterSignUpUrl='/learn'
>
<Button size='lg' variant='ghost'>
Login
</Button>
</SignInButton>
</SignedOut>
<Link
// href={links.sourceCode}
href='/'
target='_blank'
rel='noreferrer noopener'
className={userId ? 'pt-1.5' : 'pt-3'}
>
</Link>
</ClerkLoaded>
</div>
</div>
</header>
);
};
Type '{ children: Element; mode: "modal"; afterSignInUrl: string; afterSignUpUrl: string; }' is not assignable to type 'IntrinsicAttributes & Without<WithClerkProp<SignInButtonProps>, "clerk">'.
Property 'afterSignInUrl' does not exist on type 'IntrinsicAttributes & Without<WithClerkProp<SignInButtonProps>, "clerk">'.
app-index.js:33 Warning: React does not recognize the `afterSignUpUrl` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `aftersignupurl` instead. If you accidentally passed it from a parent component, remove it from the DOM element.
at button