mirror of
https://github.com/orangecoding/fredy.git
synced 2026-06-16 12:31:07 +00:00
25 lines
528 B
JavaScript
25 lines
528 B
JavaScript
import React from 'react';
|
|
import { Button } from '@douyinfe/semi-ui';
|
|
import { xhrPost } from '../../services/xhr';
|
|
import { IconUser } from '@douyinfe/semi-icons';
|
|
|
|
const Logout = function Logout({ text }) {
|
|
return (
|
|
<div>
|
|
<Button
|
|
icon={<IconUser />}
|
|
type="danger"
|
|
theme="solid"
|
|
onClick={async () => {
|
|
await xhrPost('/api/login/logout');
|
|
location.reload();
|
|
}}
|
|
>
|
|
{text && 'Logout'}
|
|
</Button>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default Logout;
|