File size: 630 Bytes
9705b6c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | import { forwardRef } from 'react';
import { LogOutIcon } from '../svg';
import { useAuthContext } from '~/hooks/AuthContext';
import { useLocalize } from '~/hooks';
const Logout = forwardRef(() => {
const { logout } = useAuthContext();
const localize = useLocalize();
const handleLogout = () => {
logout();
};
return (
<button
className="flex w-full cursor-pointer items-center gap-3 px-3 py-3 text-sm text-white transition-colors duration-200 hover:bg-gray-700"
onClick={handleLogout}
>
<LogOutIcon />
{localize('com_nav_log_out')}
</button>
);
});
export default Logout;
|