Files
Checkmate/Client/src/Components/RadioButton/index.jsx
T

51 lines
1.3 KiB
React
Raw Normal View History

2024-06-20 19:53:08 +03:30
/**
* RadioButton component.
*
* @component
* @example
* // Usage:
* <RadioButton
* title="Radio Button Title"
* desc="Radio Button Description"
* size="small"
* />
*
* @param {Object} props - The component props.
* @param {string} props.title - The title of the radio button.
* @param {string} [props.desc] - The description of the radio button.
* @param {string} [props.size="small"] - The size of the radio button.
* @returns {JSX.Element} - The rendered RadioButton component.
*/
import { FormControlLabel, Radio } from "@mui/material";
import React from "react";
2024-06-26 21:56:56 +03:30
import "./index.css";
2024-06-20 19:53:08 +03:30
import PropTypes from "prop-types";
function RadioButton(props) {
return (
<div className="custom-radio-button">
<FormControlLabel
2024-06-25 13:22:28 +03:30
checked={props.checked}
value={props.value}
2024-06-20 19:53:08 +03:30
control={<Radio size={props.size} />}
2024-06-25 13:22:28 +03:30
onChange={props.onChange}
2024-06-20 19:53:08 +03:30
label={
<div>
<div className="service-check-list-title">{props.title}</div>
<div className="service-check-list-desc">{props.desc}</div>
</div>
}
labelPlacement="end"
/>
</div>
);
}
RadioButton.propTypes = {
title: PropTypes.string.isRequired,
desc: PropTypes.string,
size: PropTypes.string,
};
export default RadioButton;