2025-12-11 10:40:55 +01:00
|
|
|
/*
|
2026-01-12 15:00:36 +01:00
|
|
|
* Copyright (c) 2026 by Christian Kellner.
|
2025-12-11 10:40:55 +01:00
|
|
|
* Licensed under Apache-2.0 with Commons Clause and Attribution/Naming Clause
|
|
|
|
|
*/
|
|
|
|
|
|
2021-01-21 16:09:23 +01:00
|
|
|
import { xhrPost } from '../../services/xhr';
|
2023-03-20 08:52:13 +01:00
|
|
|
import { IconUser } from '@douyinfe/semi-icons';
|
2025-09-29 20:36:56 +02:00
|
|
|
|
|
|
|
|
const Logout = function Logout({ text }) {
|
2026-04-22 21:11:18 +02:00
|
|
|
const handleLogout = async () => {
|
|
|
|
|
await xhrPost('/api/login/logout');
|
|
|
|
|
location.reload();
|
|
|
|
|
};
|
|
|
|
|
|
2021-01-21 16:09:23 +01:00
|
|
|
return (
|
2026-04-22 21:11:18 +02:00
|
|
|
<button className={`navigate__logout-btn${!text ? ' navigate__logout-btn--icon-only' : ''}`} onClick={handleLogout}>
|
|
|
|
|
<IconUser size="default" />
|
|
|
|
|
{text && 'Logout'}
|
|
|
|
|
</button>
|
2021-01-21 16:09:23 +01:00
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default Logout;
|