import { useTranslation } from "react-i18next";
import { FiLogOut } from "react-icons/fi";
import useLocalStorage from "../../hooks/useLocalStorage";
import RoundButtonBase from "../atoms/RoundButtonBase";
import IconBase from "../molecules/IconBase";

const LogoutButton = () => {
	const [, setIsLoggedIn] = useLocalStorage("isLoggedIn", false);
	const { t } = useTranslation();

	const handleLogout = () => {
		setIsLoggedIn(false);
	};

	return (
		<RoundButtonBase
			buttonProps={{
				onClick: handleLogout,
			}}
			tooltipText={t("button.action.logout")}
		>
			<IconBase>
				<FiLogOut />
			</IconBase>
		</RoundButtonBase>
	);
};

export default LogoutButton;
