Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/github_actions/guibranco/github-i…
Browse files Browse the repository at this point in the history
…nfisical-secrets-check-action-1.1.3
  • Loading branch information
gstraccini[bot] authored Sep 22, 2024
2 parents efaf036 + 9bfc5bf commit f92a282
Showing 1 changed file with 24 additions and 15 deletions.
39 changes: 24 additions & 15 deletions src/Components/Issues/IssueItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,43 @@ import classNames from "classnames";
import reactStringReplace from "react-string-replace";

/**
* Represents a component that displays information about a specific issue.
* A functional component that displays information about a specific issue.
*
* @component
* @param {Object} props - The properties for the component.
* @param {Object} props - The properties passed to 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 {string} props.issue.user.login - The login name of the issue's author.
* @param {string} props.issue.user.name - The name of the issue's author (optional).
* @param {string} props.issue.user.avatar_url - The URL of the author's avatar.
* @param {Object} props.issue.repository - The repository where the issue is located.
* @param {string} props.issue.repository.organization.login - The login name of the organization.
* @param {string} props.issue.repository.organization.avatar_url - The URL of the organization's avatar.
* @param {string} props.issue.title - The title of the issue.
* @param {string} props.issue.created_at - The creation date of the issue in ISO format.
* @param {string} props.issue.updated_at - The last updated date of the issue in ISO format.
* @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 {Array<Object>} 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.
*
* @returns {JSX.Element} A card component displaying the issue details, including author and organization information,
* creation and update dates, comment count, and labels.
*
* @example
* const exampleIssue = {
* user: { login: 'johnDoe' },
* repository: { organization: { login: 'orgName', avatar_url: 'url' }, name: 'repoName' },
* const issue = {
* user: { login: 'johnDoe', name: 'John Doe', avatar_url: 'https://example.com/avatar.jpg' },
* repository: {
* organization: { login: 'exampleOrg', avatar_url: 'https://example.com/org-avatar.jpg' },
* name: 'exampleRepo'
* },
* title: 'Issue Title',
* 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'
* url: 'https://github.com/exampleOrg/exampleRepo/issues/1'
* };
*
* <IssueItem issue={exampleIssue} />
*
* @throws {Error} Throws an error if the issue object is not provided or is malformed.
* <IssueItem issue={issue} />
*/
const IssueItem = ({ issue }) => {
const authorUrl = "/?authors=" + issue.user.login;
Expand Down

0 comments on commit f92a282

Please sign in to comment.