import React from 'react';
import styled from 'styled-components';
import { getHeight } from '../utils';
var TrackHighlight = styled.div.withConfig({
  displayName: "SliderTrackHighlight__TrackHighlight",
  componentId: "sc-p47ej5-0"
})(["background:", ";border-radius:inherit;height:", ";position:absolute;width:100%;"], function (p) {
  var getBackgroundColor = function getBackgroundColor() {
    if (p.$disabled) {
      return p.theme.color.sliderDisabled;
    }
    if (p.$sliderColor) {
      return p.$sliderColor(p.theme);
    }
    return p.theme.color.sliderColor;
  };
  return getBackgroundColor();
}, function (p) {
  return "".concat(getHeight(p.$variant), "px");
});
var SliderTrackHighlight = function SliderTrackHighlight(_ref) {
  var disabled = _ref.disabled,
    sliderColor = _ref.sliderColor,
    _ref$startValue = _ref.startValue,
    startValue = _ref$startValue === void 0 ? 0 : _ref$startValue,
    value = _ref.value,
    variant = _ref.variant;
  return React.createElement(TrackHighlight, {
    $disabled: disabled,
    $sliderColor: sliderColor,
    $variant: variant,
    style: {
      left: "".concat(startValue, "%"),
      width: "".concat(value - startValue, "%")
    }
  });
};
export default SliderTrackHighlight;