Skip to content

Commit

Permalink
Added Component Documentations
Browse files Browse the repository at this point in the history
- Added AdminCantFindApt component documentation
- Added AdminContactQuestion component documentation
  • Loading branch information
CasperL1218 committed Feb 10, 2025
1 parent fbb258e commit d742e0f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
15 changes: 15 additions & 0 deletions frontend/src/components/Admin/AdminCantFindApt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,21 @@ type Props = {
readonly photos?: readonly string[];
};

/**
* AdminCantFindApt - A component that displays information about apartment submissions from users who couldn't find their apartment.
*
* @remarks
* This component renders a card containing details about an apartment submission, including the apartment name,
* address, submission date, and any photos provided. It is used in the admin interface to review and manage
* apartment submissions from users.
*
* @param {Date} props.date - The date when the apartment submission was made
* @param {string} props.apartmentName - The name of the apartment building/complex submitted
* @param {string} props.apartmentAddress - The street address of the apartment
* @param {readonly string[]} props.photos - Optional array of photo URLs showing the apartment
*
* @returns {ReactElement} - A Card component containing the formatted apartment submission details
*/
const AdminCantFindApt = ({
date,
apartmentName,
Expand Down
15 changes: 15 additions & 0 deletions frontend/src/components/Admin/AdminContactQuestion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,21 @@ type Props = {
readonly msg: string;
};

/**
* AdminContactQuestion - A component that displays contact questions submitted by users through the contact form.
*
* @remarks
* This component renders a card containing details about a contact question submission, including the user's name,
* email, message content, and submission date. It is used in the admin interface to review and manage
* user inquiries and questions.
*
* @param {Date} props.date - The date when the question was submitted
* @param {string} props.name - The name of the user who submitted the question
* @param {string} props.email - The email address of the user
* @param {string} props.msg - The message/question content submitted by the user
*
* @returns {ReactElement} - A Card component containing the formatted contact question details
*/
const AdminContactQuestion = ({ date, name, email, msg }: Props): ReactElement => {
const classes = useStyles();
const formattedDate = new Date(date).toLocaleString('en-US', {
Expand Down

0 comments on commit d742e0f

Please sign in to comment.