diff options
| author | l3wdfut4pwr <l3wdfut4pwr@gmail.com> | 2025-12-30 13:46:39 +0200 |
|---|---|---|
| committer | l3wdfut4pwr <l3wdfut4pwr@gmail.com> | 2025-12-30 13:46:39 +0200 |
| commit | c3dcb9c827df6d80ad1b0b1a7c6155561527b39d (patch) | |
| tree | 76d8b9e706f9e8fcf7acc157a633905ff16c6b74 /src/components/header/ProfileOrLogin.tsx | |
init
Diffstat (limited to 'src/components/header/ProfileOrLogin.tsx')
| -rw-r--r-- | src/components/header/ProfileOrLogin.tsx | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/components/header/ProfileOrLogin.tsx b/src/components/header/ProfileOrLogin.tsx new file mode 100644 index 0000000..38c1eb1 --- /dev/null +++ b/src/components/header/ProfileOrLogin.tsx @@ -0,0 +1,25 @@ +'use client'; + +import Image from 'next/image'; +import { useUser } from '../../lib/contexts'; +import { Button } from '../ui'; +import Link from 'next/link'; + +export function ProfileOrLogin() { + const user = useUser(); + + if (!user) { + return <Button className="py-2.5 px-3.75">ВОЙТИ</Button>; + } + + return ( + <Link href={'/profile'}> + <Image + src={user?.avatar ?? 'icons/avatar.svg'} + alt="" + width={60} + height={60} + /> + </Link> + ); +} |
