feat(core): sgw-device-ui

This commit is contained in:
Tran Anh Tuan
2025-09-26 18:22:04 +07:00
parent 466e931537
commit 2707b92f7e
88 changed files with 19104 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
import { ModalForm, ProFormTextArea } from '@ant-design/pro-components';
import { Button, Form } from 'antd';
interface CancelTripProps {
onFinished?: (note: string) => void;
}
const CancelTrip: React.FC<CancelTripProps> = ({ onFinished }) => {
const [form] = Form.useForm<{ note: string }>();
return (
<ModalForm
title="Xác nhận huỷ chuyến đi"
form={form}
modalProps={{
destroyOnHidden: true,
onCancel: () => console.log('run'),
}}
trigger={
<Button color="danger" variant="solid">
Huỷ chuyến đi
</Button>
}
onFinish={async (values) => {
onFinished?.(values.note);
return true;
}}
>
<ProFormTextArea
name="note"
label="Lý do: "
placeholder={'Nhập lý do huỷ chuyến đi...'}
rules={[
{ required: true, message: 'Vui lòng nhập lý do huỷ chuyến đi' },
]}
/>
</ModalForm>
);
};
export default CancelTrip;