import { createAction } from '@reduxjs/toolkit';
import {IAuthorizationState} from '../../../typescript/redux/authorization/interfaces'

const actionLogInSuccess = createAction('login/success', (value:string) => ({
  payload: value,
}));

const actionLogInReject = createAction('login/reject', () => ({
  payload: null,
}));

const actionLogOutSuccess = createAction('logout/success', () => ({
  payload: null,
}));

const actionLogOutReject = createAction('logout/reject', () => ({
  payload: null,
}));

const actionCurrentSuccess = createAction('current/success', (value:IAuthorizationState) => ({
  payload: value,
}));

const actionCurrentReject = createAction('current/reject', () => ({
  payload: null,
}));

export {
  actionLogInSuccess,
  actionLogInReject,
  actionLogOutSuccess,
  actionLogOutReject,
  actionCurrentSuccess,
  actionCurrentReject
};
