* feat: replace `create-react-app` with `vite` * fix: correct axios-override extension * chore: add more extensions to lint-staged
42 lines
856 B
React
42 lines
856 B
React
import React from "react";
|
|
import PropTypes from "prop-types";
|
|
|
|
import { Section } from "./Section";
|
|
import { Checkbox } from "../Generic/Checkbox";
|
|
|
|
const CheckboxSection = ({
|
|
title,
|
|
text,
|
|
question,
|
|
variable,
|
|
setVariable,
|
|
disabled,
|
|
}) => {
|
|
return (
|
|
<Section title={title}>
|
|
{text && <p dangerouslySetInnerHTML={{ __html: text }} />}
|
|
<Checkbox
|
|
question={question}
|
|
variable={variable}
|
|
setVariable={setVariable}
|
|
disabled={disabled}
|
|
/>
|
|
</Section>
|
|
);
|
|
};
|
|
|
|
CheckboxSection.propTypes = {
|
|
title: PropTypes.string.isRequired,
|
|
text: PropTypes.string,
|
|
question: PropTypes.string.isRequired,
|
|
variable: PropTypes.bool.isRequired,
|
|
setVariable: PropTypes.func.isRequired,
|
|
disabled: PropTypes.bool,
|
|
};
|
|
|
|
CheckboxSection.defaultProps = {
|
|
disabled: false,
|
|
};
|
|
|
|
export { CheckboxSection };
|