RotateActionForm.jsx 551 B

123456789101112131415161718192021222324
  1. import React from "react";
  2. import { useTranslation } from "react-i18next";
  3. import { Field } from "react-final-form";
  4. import Label from "../../ui/formUtils/Label";
  5. const Form = ({ name, initialValues = { angle: 25 } }) => {
  6. const { t } = useTranslation();
  7. return (
  8. <>
  9. <Label>
  10. {t("Angle")}
  11. <Field
  12. name={`${name}.angle`}
  13. component="input"
  14. parse={(value) => parseInt(value, 10) || 0}
  15. initialValue={initialValues.angle}
  16. />
  17. </Label>
  18. </>
  19. );
  20. };
  21. export default Form;