Added base jobline edit modal. To be confirmed if required.
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import { Input, Modal } from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function JobLinesUpsertModalComponent({
|
||||
visible,
|
||||
changeVisibility,
|
||||
lineState,
|
||||
setLineState,
|
||||
updateExistingLine,
|
||||
insertNewLine
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
const handleChange = e => {
|
||||
setLineState({ ...lineState, [e.target.name]: e.target.value });
|
||||
};
|
||||
return (
|
||||
<Modal
|
||||
title={
|
||||
lineState.id ? t("joblines.actions.edit") : t("joblines.actions.new")
|
||||
}
|
||||
visible={visible}
|
||||
okText={t("general.labels.save")}
|
||||
onOk={() => {
|
||||
lineState.id ? updateExistingLine() : insertNewLine();
|
||||
}}
|
||||
onCancel={() => {
|
||||
changeVisibility(false);
|
||||
}}>
|
||||
<Input.TextArea rows={8} value={lineState.text} onChange={handleChange} />
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user