diff options
Diffstat (limited to 'src/app')
| -rw-r--r-- | src/app/profile/AccountButton.tsx | 17 | ||||
| -rw-r--r-- | src/app/profile/[username]/page.tsx | 2 |
2 files changed, 18 insertions, 1 deletions
diff --git a/src/app/profile/AccountButton.tsx b/src/app/profile/AccountButton.tsx new file mode 100644 index 0000000..6eb0519 --- /dev/null +++ b/src/app/profile/AccountButton.tsx @@ -0,0 +1,17 @@ +'use client'; + +import Link from 'next/link'; +import { Button } from '@/components/ui'; +import { useUser } from '@/lib/contexts/Auth.context'; + +export default function AccountButton() { + const user = useUser(); + + if (!user) return null; + + return ( + <Button asChild> + <Link href="/settings">Управление аккаунтом</Link> + </Button> + ); +} diff --git a/src/app/profile/[username]/page.tsx b/src/app/profile/[username]/page.tsx index ea13b36..cb79b7b 100644 --- a/src/app/profile/[username]/page.tsx +++ b/src/app/profile/[username]/page.tsx @@ -1,4 +1,4 @@ -import AccountButton from '@/components/settings/AccountButton'; +import AccountButton from '../AccountButton'; import { getUserByUsername } from '@/lib/api/user'; import { User } from '@/lib/contexts/Auth.context'; |
