Skip to content
Merged
Show file tree
Hide file tree
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
25 changes: 24 additions & 1 deletion src/components/CIAnalytics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ export default function CIAnalytics() {
: "Rate limited"
: "Refresh";

const hasNoCIData = !!data && data.totalRuns === 0;

return (
<div className="rounded-xl border border-[var(--border)] bg-[var(--card)] p-6 shadow-sm transition-all duration-300 hover:shadow-md hover:-translate-y-1">
<div className="mb-4 flex items-start justify-between gap-3">
Expand Down Expand Up @@ -163,6 +165,27 @@ export default function CIAnalytics() {
</button>
)}
</div>
) : hasNoCIData ? (
<div className="flex flex-col items-center justify-center py-10 text-center">
<div className="mb-3 text-4xl">⚙️</div>

<h3 className="text-sm font-semibold text-[var(--card-foreground)]">
No CI runs detected
</h3>

<p className="mt-2 max-w-sm text-sm text-[var(--muted-foreground)]">
Set up GitHub Actions to see workflow and build analytics here.
</p>

<a
href="https://docs.github.com/actions"
target="_blank"
rel="noopener noreferrer"
className="mt-4 inline-flex rounded-md border border-[var(--border)] px-4 py-2 text-sm font-medium hover:bg-[var(--control)]"
>
Learn GitHub Actions
</a>
</div>
) : data ? (
<div className="space-y-4">
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4 stagger-children">
Expand All @@ -180,7 +203,7 @@ export default function CIAnalytics() {
</div>
))}
</div>

<div className="rounded-lg bg-[var(--control)] p-4 stat-cell">
<p className="text-sm font-medium text-[var(--card-foreground)]">
Flakiest workflow
Expand Down
27 changes: 27 additions & 0 deletions src/components/DiscussionsWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ export default function DiscussionsWidget() {
]
: [];

const hasNoDiscussionData =
!!data &&
data.discussionsStarted === 0 &&
data.commentsGiven === 0 &&
data.markedAsAnswer === 0;

return (
<div className="rounded-xl border border-[var(--border)] bg-[var(--card)] p-6 shadow-sm transition-all duration-300 hover:shadow-md hover:-translate-y-1">
<h2 className="mb-4 text-lg font-semibold text-[var(--card-foreground)]">
Expand All @@ -78,6 +84,27 @@ export default function DiscussionsWidget() {
Try again
</button>
</div>
) : hasNoDiscussionData ? (
<div className="flex flex-col items-center justify-center py-10 text-center">
<div className="mb-3 text-4xl">💬</div>

<h3 className="text-sm font-semibold text-[var(--card-foreground)]">
No discussion activity yet
</h3>

<p className="mt-2 max-w-sm text-sm text-[var(--muted-foreground)]">
Participate in GitHub Discussions to see your activity metrics here.
</p>

<a
href="https://github.com/discussions"
target="_blank"
rel="noopener noreferrer"
className="mt-4 inline-flex rounded-md border border-[var(--border)] px-4 py-2 text-sm font-medium hover:bg-[var(--control)]"
>
Explore Discussions
</a>
</div>
) : (
<div className="grid grid-cols-1 sm:grid-cols-3 gap-4 stagger-children">
{stats.map((stat) => (
Expand Down
22 changes: 21 additions & 1 deletion src/components/TopRepos.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -456,9 +456,29 @@ export default function TopRepos() {
</button>
</div>
) : repos.length === 0 ? (
<p className="text-sm text-[var(--muted-foreground)]">No commits in the last {days} days.</p>
<div className="flex flex-col items-center justify-center py-10 text-center">
<div className="mb-3 text-4xl">📦</div>

<h3 className="text-sm font-semibold text-[var(--card-foreground)]">
No repositories found
</h3>

<p className="mt-2 max-w-sm text-sm text-[var(--muted-foreground)]">
Push your first commit on GitHub to get started and see repository activity here.
</p>

<a
href="https://github.com/new"
target="_blank"
rel="noopener noreferrer"
className="mt-4 inline-flex rounded-md border border-[var(--border)] px-4 py-2 text-sm font-medium hover:bg-[var(--control)]"
>
Create Repository
</a>
</div>
) : (
<>

<div className="relative mb-4">
<Search className="absolute left-3 top-2.5 h-4 w-4 text-[var(--muted-foreground)]" aria-hidden="true" />
<input
Expand Down
Loading