import { Button } from "antd";
import { LogoutOutlined } from "@ant-design/icons";
import { setAuth } from "./stores/auth";
import { api } from "./api";

export function SignOut() {
  return (
    <div className="absolute top-[20px] right-[20px]">
      <Button
        icon={<LogoutOutlined />}
        type="primary"
        size="large"
        title="Выйти"
        onClick={async () => {
          await api.post("accounts/logout/");

          setAuth(false);
        }}
      />
    </div>
  );
}
