diff --git a/src/pages/ContributorsPage.jsx b/src/pages/ContributorsPage.jsx index e89fd97..abe6b42 100644 --- a/src/pages/ContributorsPage.jsx +++ b/src/pages/ContributorsPage.jsx @@ -56,6 +56,7 @@ export default function ContributorsPage() { const { sorted, sortConfig, onSort } = useSortedData(filtered, 'totalContribs', 'desc') const visible = sorted.slice(0, shown) + const showNoSearchResults = search.trim() && filtered.length === 0 if(loading) return if (!model) return null @@ -249,8 +250,33 @@ export default function ContributorsPage() { {filtered.length} contributors found - {contributors?.length ? - (<> + + {!contributors?.length && ( +
+ } + title="No contributors found" + description="We couldn't find any contributor data for this organization. " + buttonText="Go to Home" + onButtonClick={() => navigate('/')} + /> +
+ )} + + {contributors?.length > 0 && showNoSearchResults && ( +
+ } + title="No matching contributors" + description="No contributors match your search. Try a different username." + buttonText="Clear Search" + onButtonClick={() => setSearch('')} + /> +
+ )} + + {contributors?.length > 0 && !showNoSearchResults && ( + <> @@ -366,25 +392,11 @@ export default function ContributorsPage() { ))} - -
- setShown(s => s + 20)} />) : - (<> -
- } - title="No contributors found" - description="We couldn't find any contributor data for this organization. " - buttonText="Go to Home" - onButtonClick={() => navigate('/')} /> -
- )} + + + setShown(s => s + 20)} /> + + )} ) diff --git a/src/pages/RepositoriesPage.jsx b/src/pages/RepositoriesPage.jsx index f5884f4..9fbbd81 100644 --- a/src/pages/RepositoriesPage.jsx +++ b/src/pages/RepositoriesPage.jsx @@ -54,7 +54,7 @@ export default function RepositoriesPage() { const { sorted, sortConfig, onSort } = useSortedData(filtered, 'healthScore', 'desc') const visible = sorted.slice(0, shown) - if(loading) return + if (loading) return if (!model) return null const TABLE_COLS = [ @@ -66,6 +66,8 @@ export default function RepositoriesPage() { ['pushed_at', 'Repository Activity'], ] + const showNoSearchResults = search.trim() && filtered.length === 0 + return (
- {allRepos?.length ? ( - <> - {/* Table view */} -
- - - - {TABLE_COLS.map(([k, l]) => ( - - ))} - - - - {visible.map((r, i) => ( - - - - - - - - + + {!allRepos?.length && ( +
+ } + title="No repositories available" + description="We couldn't find any repositories for this organization yet." + buttonText="Go to Home" + onButtonClick={() => navigate('/')} + /> +
+ )} + + {allRepos?.length > 0 && showNoSearchResults && ( +
+ } + title="No matching repositories" + description="No repositories match your search. Try a different search term." + buttonText="Clear Search" + onButtonClick={() => setSearch('')} + /> +
+ )} + + {allRepos?.length > 0 && !showNoSearchResults && ( +
+
- -
{r.name}
- {r.orgLogin &&
{r.orgLogin}
} -
-
{r.stargazers_count.toLocaleString()}{r.forks_count.toLocaleString()} 30 ? 'var(--red)' : 'var(--text2)' }}>{r.open_issues_count} -
- - Last push: {r.pushed_at?.slice(0, 10)} - -
-
+ + + {TABLE_COLS.map(([k, l]) => ( + ))} - -
- setShown(s => s + 20)} /> -
- ) - : ( -
- } - title="No repositories available" - description="We couldn't find any repositories for this organization yet." - buttonText="Go to Home" - onButtonClick={() => navigate('/')} - /> -
- )} - + + + + {visible.map((r, i) => ( + + + +
{r.name}
+ {r.orgLogin &&
{r.orgLogin}
} +
+ + {r.stargazers_count.toLocaleString()} + {r.forks_count.toLocaleString()} + 30 ? 'var(--red)' : 'var(--text2)' }}>{r.open_issues_count} + + +
+ + Last push: {r.pushed_at?.slice(0, 10)} + +
+ + + ))} + + + setShown(s => s + 20)} /> + ) } + + ) +} \ No newline at end of file