import React from "react";
import { useTranslation } from "react-i18next";
import { Button } from "react-native";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { signOutStart } from "../../redux/user/user.actions";
const mapStateToProps = createStructuredSelector({
  //currentUser: selectCurrentUser
});
const mapDispatchToProps = (dispatch) => ({
  //setUserLanguage: language => dispatch(setUserLanguage(language))
  signOutStart: () => dispatch(signOutStart()),
});

export function SignOutButton({ signOutStart }) {
  const { t } = useTranslation();
  return (
    <Button
      style={{ margin: 8 }}
      onPress={() => signOutStart()}
      title={t("general.actions.signout")}
    />
  );
}
export default connect(mapStateToProps, mapDispatchToProps)(SignOutButton);
