import ProductionListTable from "../../components/production-list-table/production-list-table.container";

import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { selectBodyshop } from "../../redux/user/user.selectors";
import { useTreatmentsWithConfig } from "@splitsoftware/splitio-react";

const mapStateToProps = createStructuredSelector({
  bodyshop: selectBodyshop
});
const mapDispatchToProps = () => ({
  //setUserLanguage: language => dispatch(setUserLanguage(language))
});
export default connect(mapStateToProps, mapDispatchToProps)(ProductionListComponent);

export function ProductionListComponent({ bodyshop }) {
  const {
    treatments: { Production_Use_View }
  } = useTreatmentsWithConfig({
    attributes: {},
    names: ["Production_Use_View"],
    splitKey: bodyshop?.imexshopid
  });

  return (
    <>
      <ProductionListTable bodyshop={bodyshop} subscriptionType={Production_Use_View.treatment} />
    </>
  );
}
