- the great reformat

Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
Dave Richer
2024-02-06 18:20:58 -05:00
parent 30c530bcc4
commit e83badb454
912 changed files with 108516 additions and 107493 deletions

View File

@@ -1,69 +1,70 @@
import { Button, Col, Row, Space, Form, Switch } from "antd";
import {Button, Col, Form, Row, Space, Switch} from "antd";
import {PageHeader} from "@ant-design/pro-layout";
import React from "react";
import { useTranslation } from "react-i18next";
import {useTranslation} from "react-i18next";
import ContractCarsContainer from "../../components/contract-cars/contract-cars.container";
import ContractFormComponent from "../../components/contract-form/contract-form.component";
import ContractJobsContainer from "../../components/contract-jobs/contract-jobs.container";
export default function ContractCreatePageComponent({
form,
selectedJobState,
selectedCarState,
loading,
}) {
const { t } = useTranslation();
form,
selectedJobState,
selectedCarState,
loading,
}) {
const {t} = useTranslation();
const CreateButton = (
<Space size="large">
{selectedJobState[0] && selectedCarState[0] && (
<Form.Item
label={t("jobs.actions.addtoproduction")}
name="addtoproduction"
valuePropName="checked"
>
<Switch />
</Form.Item>
)}
<Button
disabled={!selectedJobState[0] || !selectedCarState[0]}
type="primary"
onClick={() => form.submit()}
loading={loading}
>
{t("general.actions.create")}
</Button>
</Space>
);
const CreateButton = (
<Space size="large">
{selectedJobState[0] && selectedCarState[0] && (
<Form.Item
label={t("jobs.actions.addtoproduction")}
name="addtoproduction"
valuePropName="checked"
>
<Switch/>
</Form.Item>
)}
<Button
disabled={!selectedJobState[0] || !selectedCarState[0]}
type="primary"
onClick={() => form.submit()}
loading={loading}
>
{t("general.actions.create")}
</Button>
</Space>
);
return (
<div>
<Row gutter={[16, 16]}>
<Col span={24}>
<ContractJobsContainer selectedJobState={selectedJobState} />
</Col>
<Col span={24}>
<ContractCarsContainer
selectedCarState={selectedCarState}
form={form}
/>
</Col>
<Col span={24}>
<div
style={{
display: selectedJobState[0] && selectedCarState[0] ? "" : "none",
}}
>
<ContractFormComponent
create
form={form}
selectedJobState={selectedJobState}
selectedCar={selectedCarState[0]}
/>
</div>
</Col>
</Row>
<PageHeader extra={CreateButton} />
</div>
);
return (
<div>
<Row gutter={[16, 16]}>
<Col span={24}>
<ContractJobsContainer selectedJobState={selectedJobState}/>
</Col>
<Col span={24}>
<ContractCarsContainer
selectedCarState={selectedCarState}
form={form}
/>
</Col>
<Col span={24}>
<div
style={{
display: selectedJobState[0] && selectedCarState[0] ? "" : "none",
}}
>
<ContractFormComponent
create
form={form}
selectedJobState={selectedJobState}
selectedCar={selectedCarState[0]}
/>
</div>
</Col>
</Row>
<PageHeader extra={CreateButton}/>
</div>
);
}