Skip to content

Commit

Permalink
Add propTypes and JSDOC comments
Browse files Browse the repository at this point in the history
  • Loading branch information
samau3 committed Aug 23, 2024
1 parent a69e7c4 commit 5f0750f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
21 changes: 13 additions & 8 deletions client/src/pages/patients/MedicalDataSearch.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
import {
TextInput,
Loader,
Combobox,
useCombobox,
Pill,
PillsInput,
} from '@mantine/core';
import PropTypes from 'prop-types';

import { Loader, Combobox, useCombobox, Pill, PillsInput } from '@mantine/core';
import { useState, useRef } from 'react';

const medicalDataSearchProps = {

Check failure on line 6 in client/src/pages/patients/MedicalDataSearch.jsx

View workflow job for this annotation

GitHub Actions / CI

'medicalDataSearchProps' is assigned a value but never used
category: PropTypes.string.isRequired,
handleMedicalData: PropTypes.func.isRequired,
};

/**
* Medical Data Search component for Medical Data section of patient form
* @param {PropTypes.InferProps<typeof medicalDataSearchProps>} props
*/

export default function MedicalDataSearch({ category, handleMedicalData }) {

Check warning on line 16 in client/src/pages/patients/MedicalDataSearch.jsx

View workflow job for this annotation

GitHub Actions / CI

Missing JSDoc comment

Check failure on line 16 in client/src/pages/patients/MedicalDataSearch.jsx

View workflow job for this annotation

GitHub Actions / CI

'category' is missing in props validation

Check failure on line 16 in client/src/pages/patients/MedicalDataSearch.jsx

View workflow job for this annotation

GitHub Actions / CI

'handleMedicalData' is missing in props validation
const [loading, setLoading] = useState(false);
const [data, setData] = useState([]);
Expand Down
7 changes: 6 additions & 1 deletion client/src/pages/patients/patients.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import { useState, useRef } from 'react';
import { useState } from 'react';
import { Accordion, TextInput, Select } from '@mantine/core';

import MedicalDataSearch from './MedicalDataSearch';

/**
* Patients page component
*
*/

export default function Patients() {

Check warning on line 11 in client/src/pages/patients/patients.jsx

View workflow job for this annotation

GitHub Actions / CI

Missing JSDoc comment
const [patientForm, setPaitentForm] = useState({
firstName: '',
Expand Down

0 comments on commit 5f0750f

Please sign in to comment.