Skip to content

Commit

Permalink
Add JSDoc comment
Browse files Browse the repository at this point in the history
  • Loading branch information
samau3 committed Oct 22, 2024
1 parent 58d8997 commit 0574c8e
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions client/src/pages/patients/PatientsTable.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';

import { Paper, Table, ActionIcon, Menu } from '@mantine/core';
import {
IconDotsVertical,
Expand All @@ -8,6 +10,29 @@ import {
import { Link } from 'react-router-dom';
import classes from './Patients.module.css';

const patientTableProps = {
headers: PropTypes.arrayOf(
PropTypes.shape({
key: PropTypes.string.isRequired,
text: PropTypes.node,
}),
),
data: PropTypes.arrayOf(
PropTypes.shape({
id: PropTypes.string.isRequired,
name: PropTypes.string.isRequired,
createdBy: PropTypes.string.isRequired,
createdAt: PropTypes.string.isRequired,
updatedBy: PropTypes.string.isRequired,
updatedAt: PropTypes.string.isRequired,
}),
),
};

/**
* Patients table component
* @param {PropTypes.InferProps<typeof patientTableProps>} props
*/
export default function PatientsTable({ headers, data }) {
return (
<Paper withBorder>
Expand Down Expand Up @@ -66,3 +91,5 @@ export default function PatientsTable({ headers, data }) {
</Paper>
);
}

PatientsTable.propTypes = patientTableProps;

0 comments on commit 0574c8e

Please sign in to comment.