24 lines
514 B
TypeScript
24 lines
514 B
TypeScript
'use client';
|
|
|
|
import { logout } from '@/app/login/actions';
|
|
|
|
interface LogoutButtonProps {
|
|
className?: string;
|
|
children?: React.ReactNode;
|
|
}
|
|
|
|
export default function LogoutButton({ className, children }: LogoutButtonProps) {
|
|
const handleLogout = async () => {
|
|
await logout();
|
|
};
|
|
|
|
return (
|
|
<button
|
|
onClick={handleLogout}
|
|
className={className || "px-4 py-2 bg-red-600 hover:bg-red-700 text-white rounded-lg transition-colors"}
|
|
>
|
|
{children || 'Abmelden'}
|
|
</button>
|
|
);
|
|
}
|