'use client';

import style from '@/styles/admin.module.scss';

export function LogoutButton() {
  return (
    <button
      type="button"
      className={style.btnGhost}
      onClick={async () => {
        await fetch('/api/auth/logout', { method: 'POST', credentials: 'include' });
        window.location.href = '/admin/login';
      }}
    >
      Log out
    </button>
  );
}
