30 lines
593 B
TypeScript
30 lines
593 B
TypeScript
import { cn } from "@/lib/utils";
|
||
import { signOut } from "next-auth/react";
|
||
|
||
interface ILogoutButtonProps {
|
||
className?: string;
|
||
}
|
||
|
||
const LogoutButton: React.FC<ILogoutButtonProps> = ({
|
||
className,
|
||
}: ILogoutButtonProps) => {
|
||
return (
|
||
<button
|
||
type="button"
|
||
className={cn(
|
||
"p-[10px] border border-red-500 rounded-sm font-semibold leading-5 text-red-500",
|
||
className
|
||
)}
|
||
onClick={() =>
|
||
signOut({
|
||
callbackUrl: "/",
|
||
})
|
||
}
|
||
>
|
||
Выйти из аккаунта
|
||
</button>
|
||
);
|
||
};
|
||
|
||
export default LogoutButton;
|