change ovalStart to vowelStart, add default value, add proptypes and JSdoc

This commit is contained in:
Alex Holliday
2024-12-03 11:00:21 +08:00
parent 0e8bccfea1
commit 74251a9801

View File

@@ -16,11 +16,11 @@ import "./index.css";
* @param {string} props.title - The title to be displayed in the fallback UI.
* @param {Array<string>} props.checks - An array of strings representing the checks to display.
* @param {string} [props.link="/"] - The link to navigate to.
*
* @param {boolean} [props.vowelStart=false] - Whether the title starts with a vowel.
* @returns {JSX.Element} The rendered fallback UI.
*/
const Fallback = ({ title, checks, link = "/", isAdmin, ovalStart }) => {
const Fallback = ({ title, checks, link = "/", isAdmin, vowelStart = false }) => {
const theme = useTheme();
const navigate = useNavigate();
const mode = useSelector((state) => state.ui.mode);
@@ -56,7 +56,7 @@ const Fallback = ({ title, checks, link = "/", isAdmin, ovalStart }) => {
marginY={theme.spacing(4)}
color={theme.palette.text.tertiary}
>
{ovalStart ? "An" : "A"} {title} is used to:
{vowelStart ? "An" : "A"} {title} is used to:
</Typography>
{checks.map((check, index) => (
<Check
@@ -86,6 +86,7 @@ Fallback.propTypes = {
checks: PropTypes.arrayOf(PropTypes.string).isRequired,
link: PropTypes.string,
isAdmin: PropTypes.bool,
vowelStart: PropTypes.bool,
};
export default Fallback;