Skip to content

Commit f56b087

Browse files
committed
Refactor OrgLink component to use Suspense for improved loading handling
- Introduced a new inner component, OrgLinkInner, to manage the organization-specific links. - Wrapped OrgLinkInner in a Suspense component to handle loading states more effectively. - Updated usage examples in documentation to reflect the new structure.
1 parent c4f4acf commit f56b087

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

components/org-link.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
'use client'
2+
import { Suspense } from 'react'
23
import { useSearchParams } from 'next/navigation'
34

45
/**
56
* Renders an org-specific GitHub link when ?org= query param is present.
67
* Used on the Lifecycle support page to provide direct links after disconnect.
78
*
89
* Usage in MDX:
9-
* <OrgLink path="settings/installations" label="GitHub App installations page" />
10-
* <OrgLink path="Hello-Lifecycle/settings" label="repository settings" />
10+
* <OrgLink path="settings/installations" />
11+
* <OrgLink path="<ORG>/Hello-Lifecycle/settings" />
1112
*/
12-
export default function OrgLink({ path, label }) {
13+
function OrgLinkInner({ path }) {
1314
const searchParams = useSearchParams()
1415
const org = searchParams.get('org')
1516

@@ -28,3 +29,11 @@ export default function OrgLink({ path, label }) {
2829
</p>
2930
)
3031
}
32+
33+
export default function OrgLink(props) {
34+
return (
35+
<Suspense fallback={null}>
36+
<OrgLinkInner {...props} />
37+
</Suspense>
38+
)
39+
}

0 commit comments

Comments
 (0)