Skip to content

Commit

Permalink
Merge pull request #23 from namidapoo/fix/no-data
Browse files Browse the repository at this point in the history
fix: コミットデータが0の時の表示を追加
  • Loading branch information
namidapoo authored Dec 29, 2024
2 parents 30e2d8f + b95750a commit b7fe8fb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion app/recap/components/graph/languages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ export const LanguagesUsageGraph: FC<Props> = ({ data }) => {
<CardHeader className="items-start pb-0">
<CardTitle>言語の使用率</CardTitle>
<CardDescription>
あなたが最も使用した言語は <b>{limitedData[0].language}</b> です。
{limitedData.length === 0
? "データがありません。"
: `あなたが最も使用した言語は <b>${limitedData[0].language}</b> です。`}
</CardDescription>
</CardHeader>
<CardContent className="flex-1 pb-0">
Expand Down
8 changes: 5 additions & 3 deletions app/recap/components/overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const OverView: FC<Props> = async ({ data }) => {
</CardHeader>
<CardContent className="pr-24 space-y-1">
<div className="text-sm text-muted-foreground font-bold italic truncate">
"{data.userProfile.bio}"
{data.userProfile.bio && "{data.userProfile.bio}"}
</div>
<div className="flex items-center gap-2 text-sm text-muted-foreground truncate">
<UsersRound className="h-4 w-4" />
Expand Down Expand Up @@ -188,8 +188,10 @@ export const OverView: FC<Props> = async ({ data }) => {
<CardHeader>
<CardTitle>リポジトリごとの統計</CardTitle>
<CardDescription>
あなたが最もコミットしたリポジトリは{" "}
<b>{data.repositoriesByCommitCount[0].nameWithOwner}</b> です。
{data.repositoriesByCommitCount.length === 0
? "データがありません。"
: `あなたが最もコミットしたリポジトリは{" "}
<b>${data.repositoriesByCommitCount[0].nameWithOwner}</b> です。`}
</CardDescription>
</CardHeader>
<CardContent>
Expand Down

0 comments on commit b7fe8fb

Please sign in to comment.