Skip to content
Open
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
11 changes: 8 additions & 3 deletions src/components/ActivityFeed.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useEffect, useState } from "react";

import EmptyState from "./EmptyState";
interface EventType {
id: string;
type: string;
Expand Down Expand Up @@ -56,9 +56,14 @@ export default function ActivityFeed({ username }: { username: string }) {
</h2>

{loading ? (
<p className="text-center">Loading...</p>
<div className="text-center py-6 text-gray-500">
Fetching recent activity...
</div>
) : events.length === 0 ? (
<p className="text-center">No activity found</p>
<EmptyState
title="No activity found"
description="This user has no recent public GitHub activity."
/>
) : (
events.slice(0, 10).map((event) => (
<div
Expand Down
25 changes: 25 additions & 0 deletions src/components/EmptyState.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
interface EmptyStateProps {
title: string;
description?: string;
}

export default function EmptyState({
title,
description,
}: EmptyStateProps) {
return (
<div className="flex flex-col items-center justify-center py-10 text-center">
<div className="text-5xl mb-3">📭</div>

<h2 className="text-lg font-semibold text-gray-700 dark:text-gray-200">
{title}
</h2>

{description && (
<p className="mt-2 text-sm text-gray-500 dark:text-gray-400 max-w-md">
{description}
</p>
)}
</div>
);
}
Loading