Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Penify]: Documentation for commit - 4b452aa #282

Merged
merged 2 commits into from
Sep 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 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.

Check notice on line 19 in src/Components/Issues/IssueItem.js

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/Components/Issues/IssueItem.js#L19

Delete `····`
* @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.

Check notice on line 21 in src/Components/Issues/IssueItem.js

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/Components/Issues/IssueItem.js#L21

Delete `····`
* @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