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

sign-in-button.tsx

23 lines639 Bytes

1import { Button, Flex } from '@radix-ui/themes';
2import { Link } from '@tanstack/react-router';
3import type { User } from '@workos/authkit-tanstack-react-start';
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" reloadDocument>
11 Sign Out
12 </Link>
13 </Button>
14 </Flex>
15 );
16 }
17​
18 return (
19 <Button asChild size={large ? '3' : '2'}>
20 <a href={url}>Sign In{large && ' with AuthKit'}</a>
21 </Button>
22 );