@@ -12,7 +12,8 @@ import { ErrorDisplay } from "@/components/error-display";
1212import { Skeleton } from "@/components/ui/skeleton" ;
1313import { Badge } from "@/components/ui/badge" ;
1414import { useAuth } from "@/hooks/use-auth" ;
15- import { jsonFetcher } from "@/lib/fetchers" ;
15+ import { jsonFetcher , nullOn404Fetcher } from "@/lib/fetchers" ;
16+ import { MarkdownRenderer } from "@/components/markdown-renderer" ;
1617import { ActivityEvent , type EventResponse } from "@/components/activity-event" ;
1718import { ContributionGraph } from "@/components/contribution-graph" ;
1819import { Select , SelectContent , SelectItem , SelectTrigger , SelectValue } from "@/components/ui/select" ;
@@ -58,6 +59,11 @@ interface OrgMemberRaw {
5859 role : "owner" | "admin" | "member" ;
5960}
6061
62+ interface ProfileReadmeResponse {
63+ file_name : string ;
64+ content : string ;
65+ }
66+
6167interface OrgRepo {
6268 id : string ;
6369 name : string ;
@@ -267,6 +273,11 @@ function OrgProfilePage({ name, authUserId }: { name: string; authUserId: string
267273 activeTab === "repos" ? `/api/orgs/${ name } /repos` : null ,
268274 jsonFetcher
269275 ) ;
276+ const { data : readme , isLoading : readmeLoading } = useSWR < ProfileReadmeResponse | null > (
277+ `/api/repo/${ name } /${ name } /tree/HEAD/readme` ,
278+ nullOn404Fetcher ,
279+ { shouldRetryOnError : false }
280+ ) ;
270281
271282 if ( isLoading || membersLoading ) {
272283 return < ProfileSkeleton username = { name } /> ;
@@ -375,8 +386,20 @@ function OrgProfilePage({ name, authUserId }: { name: string; authUserId: string
375386 < div className = "p-6 space-y-8" >
376387 { /* ── Overview tab ── */ }
377388 { activeTab === "overview" && (
378- < div className = "text-sm text-muted-foreground" >
379- < p > No recent activity to display yet.</ p >
389+ < div >
390+ { readmeLoading && < Skeleton className = "h-48 w-full rounded-md" /> }
391+ { ! readmeLoading && readme && (
392+ < div className = "border border-border rounded-md p-5" >
393+ < MarkdownRenderer
394+ content = { readme . content }
395+ fileName = { readme . file_name }
396+ user = { name }
397+ repo = { name }
398+ branch = "HEAD"
399+ />
400+ </ div >
401+ ) }
402+ { ! readmeLoading && ! readme && < p className = "text-sm text-muted-foreground" > No overview yet.</ p > }
380403 </ div >
381404 ) }
382405
@@ -508,6 +531,11 @@ export default function NamespacePage() {
508531
509532 const { data : orgs , isLoading : orgsLoading } = useSWR < UserOrgEntry [ ] > ( `/api/users/${ namespace } /orgs` , jsonFetcher ) ;
510533 const { data : activityFeed , isLoading : activityLoading } = useSWR < EventResponse [ ] > ( `/api/users/${ namespace } /events` , jsonFetcher ) ;
534+ const { data : readme , isLoading : readmeLoading } = useSWR < ProfileReadmeResponse | null > (
535+ `/api/repo/${ namespace } /${ namespace } /tree/HEAD/readme` ,
536+ nullOn404Fetcher ,
537+ { shouldRetryOnError : false }
538+ ) ;
511539
512540 const [ pinnedKeys , setPinnedKeys ] = useState < Set < string > > ( new Set ( ) ) ;
513541 const [ contributionYear , setContributionYear ] = useState < number | null > ( null ) ;
@@ -647,6 +675,18 @@ export default function NamespacePage() {
647675 </ aside >
648676
649677 < main className = "flex-1 min-w-0 overflow-y-auto p-4 lg:p-6 space-y-8" >
678+ { readmeLoading && < Skeleton className = "h-48 w-full rounded-md" /> }
679+ { ! readmeLoading && readme && (
680+ < section className = "border border-border rounded-md p-5" >
681+ < MarkdownRenderer
682+ content = { readme . content }
683+ fileName = { readme . file_name }
684+ user = { namespace }
685+ repo = { namespace }
686+ branch = "HEAD"
687+ />
688+ </ section >
689+ ) }
650690 < section >
651691 < div className = "flex items-center justify-between mb-3" >
652692 < h2 className = "text-xs font-medium uppercase tracking-widest text-muted-foreground" > Contributions</ h2 >
0 commit comments