Skip to content

Commit

Permalink
fix(PullRequests): limit recent PR to 5 (#263)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikewuu authored Sep 20, 2024
1 parent 4889739 commit 1394cd2
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ interface RecentPullRequestsTableProps {
pullRequests: PullRequest[]
}

const maxNumItems = 5

export default function RecentPullRequestsTable(
props: RecentPullRequestsTableProps,
) {
const { pullRequests } = props

const rows = pullRequests.map((pullRequest) => [
pullRequest.title,
pullRequest.user_username,
])
const rows = pullRequests
.filter((_pullRequest, index) => index < maxNumItems)
.map((pullRequest) => [pullRequest.title, pullRequest.user_username])

return (
<ChartCard title="Recent PRs" className="h-full">
Expand Down

0 comments on commit 1394cd2

Please sign in to comment.