mirror of
https://github.com/vercel/commerce.git
synced 2025-06-28 01:11:24 +00:00
21 lines
547 B
TypeScript
21 lines
547 B
TypeScript
'use client';
|
|
import { ArrowRightEndOnRectangleIcon } from '@heroicons/react/24/outline';
|
|
import { signOut } from 'next-auth/react';
|
|
import { useRouter } from 'next/navigation';
|
|
|
|
export default function LogoutButton() {
|
|
const router = useRouter();
|
|
return (
|
|
<button
|
|
type="button"
|
|
className="flex flex-row items-center rounded-md py-3 hover:text-indigo-500"
|
|
onClick={() => {
|
|
signOut({ callbackUrl: '/' });
|
|
}}
|
|
>
|
|
<ArrowRightEndOnRectangleIcon className="me-2 h-4" />
|
|
Logout
|
|
</button>
|
|
);
|
|
}
|