feature/IO-3255-simplified-parts-management - Add Shop / Vendor Configuration
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
import { Button, Card, Divider, Space } from "antd";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { useSocket } from "../../contexts/SocketIO/useSocket.js";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
import PartsBusinessInfoComponent from "./parts-business-info.component";
|
||||
import PartsLocationsComponent from "./parts-locations.component";
|
||||
import PartsOrderCommentsComponent from "./parts-order-comments.component";
|
||||
import PartsEmailPresetsComponent from "./parts-email-presets.component";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
bodyshop: selectBodyshop
|
||||
});
|
||||
|
||||
const mapDispatchToProps = () => ({});
|
||||
|
||||
export function PartsShopManagementComponent({ bodyshop, form, saveLoading }) {
|
||||
const { scenarioNotificationsOn } = useSocket();
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<Card
|
||||
extra={
|
||||
<Button type="primary" loading={saveLoading} onClick={() => form.submit()} id="parts-shop-save-button">
|
||||
{t("general.actions.save")}
|
||||
</Button>
|
||||
}
|
||||
>
|
||||
<Space direction="vertical" size="large" style={{ width: "100%" }}>
|
||||
{/* Business Information Section - Limited to basic shop info only */}
|
||||
<PartsBusinessInfoComponent form={form} />
|
||||
|
||||
<Divider />
|
||||
|
||||
{/* Parts Locations Section */}
|
||||
<PartsLocationsComponent form={form} />
|
||||
|
||||
<Divider />
|
||||
|
||||
{/* Parts Orders Comments Section */}
|
||||
<PartsOrderCommentsComponent form={form} />
|
||||
|
||||
{/* Preset To Emails Section - only show if notifications are enabled */}
|
||||
{scenarioNotificationsOn && (
|
||||
<>
|
||||
<Divider />
|
||||
<PartsEmailPresetsComponent form={form} />
|
||||
</>
|
||||
)}
|
||||
</Space>
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(PartsShopManagementComponent);
|
||||
Reference in New Issue
Block a user