Skip to content
Source
Sign inSign up
TanStack/router
Open History to see the last commit

sign-in-button.tsx

21 lines580 Bytes

1import { Button, Flex } from '@radix-ui/themes';
2import { Link } from '@tanstack/react-router';
3import type { User } from '@workos-inc/node';
4​
5export default function SignInButton({ large, user, url }: { large?: boolean; user: User | null; url: string }) {
6 if (user) {
7 return (
8 <Flex gap="3">
9 <Button asChild size={large ? '3' : '2'}>
10 <Link to="/logout">Sign Out</Link>
11 </Button>
12 </Flex>
13 );
14 }
15​
16 return (
17 <Button asChild size={large ? '3' : '2'}>
18 <a href={url}>Sign In{large && ' with AuthKit'}</a>
19 </Button>
20 );