Skip to content

Commit

Permalink
[Penify]: Documentation for commit - e8de3bd (#278)
Browse files Browse the repository at this point in the history
Co-authored-by: penify-dev[bot] <146478655+penify-dev[bot]@users.noreply.github.com>
  • Loading branch information
penify-dev[bot] authored Sep 18, 2024
1 parent e8de3bd commit 3d7d621
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/Components/Issues/IssueItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,36 @@ import LabelNoLinkItem from "../Labels/LabelNoLinkItem";
import classNames from "classnames";
import reactStringReplace from "react-string-replace";

/**
* Represents a component that displays information about a specific issue.
*
* @component
* @param {Object} props - The properties for the component.
* @param {Object} props.issue - The issue object containing details about the issue.
* @param {string} props.issue.user.login - The login name of the user who created the issue.
* @param {string} props.issue.repository.organization.login - The organization login associated with the issue's repository.
* @param {Date} props.issue.created_at - The date when the issue was created.
* @param {Date} props.issue.updated_at - The date when the issue was last updated.
* @param {number} props.issue.comments - The number of comments on the issue.
* @param {Array} props.issue.labels - An array of labels associated with the issue.
* @param {string} props.issue.url - The URL to view the issue on GitHub.
* @returns {JSX.Element} A rendered card component displaying issue details.
*
* @example
* const exampleIssue = {
* user: { login: 'johnDoe' },
* repository: { organization: { login: 'orgName', avatar_url: 'url' }, name: 'repoName' },
* created_at: '2023-01-01T00:00:00Z',
* updated_at: '2023-01-02T00:00:00Z',
* comments: 10,
* labels: [{ name: 'bug' }],
* url: 'https://github.com/orgName/repoName/issues/1'
* };
*
* <IssueItem issue={exampleIssue} />
*
* @throws {Error} Throws an error if the issue object is not provided or is malformed.
*/
const IssueItem = ({ issue }) => {
const authorUrl = "/?authors=" + issue.user.login;
const organizationUrl =
Expand Down

0 comments on commit 3d7d621

Please sign in to comment.