Files
bodyshop/client/src/components/config-form-components/slider/slider.component.jsx
2023-07-28 12:08:29 +08:00

39 lines
803 B
JavaScript

import { Form, Slider } from "antd";
import React from "react";
export default function JobIntakeFormCheckboxComponent({ formItem, readOnly }) {
const { name, label, required, min, max } = formItem;
const marks = {
[min]: {
label: <span style={{ height: 0 }}>&nbsp;</span>,
},
[max / 2]: {
label: <span style={{ height: 0 }}>&nbsp;</span>,
},
[max]: {
label: <span style={{ height: 0 }}>&nbsp;</span>,
},
};
return (
<Form.Item
name={name}
label={label}
rules={[
{
required: required,
//message: t("general.validation.required"),
},
]}
>
<Slider
disabled={readOnly}
min={min || 0}
max={max || 10}
marks={marks}
/>
</Form.Item>
);
}