import { useSplitTreatments } from "@splitsoftware/splitio-react"; import { Form, InputNumber } from "antd"; import React from "react"; import { useTranslation } from "react-i18next"; import { connect } from "react-redux"; import { createStructuredSelector } from "reselect"; import { selectBodyshop } from "../../redux/user/user.selectors"; import { HasFeatureAccess } from "../feature-wrapper/feature-wrapper.component"; import LayoutFormRow from "../layout-form-row/layout-form-row.component"; import RbacWrapper from "../rbac-wrapper/rbac-wrapper.component"; const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop }); const mapDispatchToProps = (dispatch) => ({ //setUserLanguage: language => dispatch(setUserLanguage(language)) }); export default connect(mapStateToProps, mapDispatchToProps)(ShopInfoRbacComponent); export function ShopInfoRbacComponent({ form, bodyshop }) { const { t } = useTranslation(); const { treatments: { Simple_Inventory } } = useSplitTreatments({ attributes: {}, names: ["Simple_Inventory"], splitKey: bodyshop && bodyshop.imexshopid }); //TODO:AIO Ensure that there are no duplicates here, it seems like there may be. return ( {...HasFeatureAccess({ featureName: "export", bodyshop }) ? [ , , , ] : []} {...HasFeatureAccess({ featureName: "bills", bodyshop }) ? [ , , , , ] : []} {...HasFeatureAccess({ featureName: "courtesycars", bodyshop }) ? [ , , , , , ] : []} {...HasFeatureAccess({ featureName: "csi", bodyshop }) ? [ , ] : []} {HasFeatureAccess({ featureName: "visualboard", bodyshop }) && ( )} {HasFeatureAccess({ featureName: "scoreboard", bodyshop }) && ( )} {...HasFeatureAccess({ featureName: "timetickets", bodyshop }) ? [ , , , , , , , , ] : []} {/* */} {HasFeatureAccess({ featureName: "media", bodyshop }) && ( )} {Simple_Inventory.treatment === "on" && ( <> )} ); }