<commit_before>import React from "react";
import PropTypes from "prop-types";
import I18n from "i18n-js";
import styledSystemPropTypes from "@styled-system/prop-types";

import Loader from "../../loader/loader.component";
import StyledSwitchSlider from "./switch-slider.style";
import SwitchSliderPanel from "./switch-slider-panel.style";
import ValidationIcon from "../../validations/validation-icon.component";
import { filterStyledSystemMarginProps } from "../../../style/utils";

const marginPropTypes = filterStyledSystemMarginProps(
  styledSystemPropTypes.space
);

const SwitchSlider = (props) => {
  const {
    checked,
    disabled,
    loading,
    size,
    error,
    warning,
    info,
    useValidationIcon,
  } = props;

  const on = I18n.t("switch.on", { defaultValue: "ON" }).toUpperCase();
  const off = I18n.t("switch.off", { defaultValue: "OFF" }).toUpperCase();

  const panelContent = checked ? on : off;

  const switchSliderStyleProps = {
    isLoading: loading,
    checked,
    disabled,
    size,
    error,
    warning,
    info,
  };

  const sliderPanelStyleProps = {
    isLoading: loading,
    size,
    type: checked ? "on" : "off",
    disabled,
  };

  const loaderProps = {
    isInsideButton: true,
    isActive: props.checked,
    ...props,
  };
<commit_msg>fix(switch-slider): pass correct props down to loader<commit_after>import React from "react";
import PropTypes from "prop-types";
import I18n from "i18n-js";
import styledSystemPropTypes from "@styled-system/prop-types";

import Loader from "../../loader/loader.component";
import StyledSwitchSlider from "./switch-slider.style";
import SwitchSliderPanel from "./switch-slider-panel.style";
import ValidationIcon from "../../validations/validation-icon.component";
import { filterStyledSystemMarginProps } from "../../../style/utils";

const marginPropTypes = filterStyledSystemMarginProps(
  styledSystemPropTypes.space
);

const SwitchSlider = (props) => {
  const {
    checked,
    disabled,
    loading,
    size,
    error,
    warning,
    info,
    useValidationIcon,
  } = props;

  const on = I18n.t("switch.on", { defaultValue: "ON" }).toUpperCase();
  const off = I18n.t("switch.off", { defaultValue: "OFF" }).toUpperCase();

  const panelContent = checked ? on : off;

  const switchSliderStyleProps = {
    isLoading: loading,
    checked,
    disabled,
    size,
    error,
    warning,
    info,
  };

  const sliderPanelStyleProps = {
    isLoading: loading,
    size,
    type: checked ? "on" : "off",
    disabled,
  };

  const loaderProps = {
    isInsideButton: true,
    isActive: props.checked,
    size,
    ...filterStyledSystemMarginProps(props),
  };

{'fraction_non_alphanumeric': 0.13410534180052297, 'fraction_numerical': 0.005976839745984311, 'mean_word_length': 3.411861614497529, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7248352', 'n_tokens_mistral': 830, 'n_tokens_neox': 821, 'n_words': 201}