import { useAuth } from '../../../app/context/AuthProvider';
import { ROLES_NAME_ID } from '../../../constants/constants';
import { Switch, Buttons, StyledNavLink } from './SwitchFormTask.style';

export function SwitchFormTask() {
  const { user } = useAuth();

  if (!user) return;

  return (
    <Switch>
      <Buttons>
        <StyledNavLink to="/tasks">Задачи</StyledNavLink>
        {user.role_id == ROLES_NAME_ID.admin && (
          <StyledNavLink to="/forms">Формы</StyledNavLink>
        )}
      </Buttons>
    </Switch>
  );
}
