mirror of
https://github.com/wasp-lang/wasp.git
synced 2024-12-29 03:53:14 +03:00
Limit stats numbers
This commit is contained in:
parent
d59f02add2
commit
d7c564043c
@ -103,6 +103,10 @@ export function Stats() {
|
|||||||
: [];
|
: [];
|
||||||
}, [stats, stats?.projects, filterOutExampleApps, filterOutKnownUsers]);
|
}, [stats, stats?.projects, filterOutExampleApps, filterOutKnownUsers]);
|
||||||
|
|
||||||
|
const limitedFilteredStats = useMemo(() => {
|
||||||
|
return filteredStats.slice(0, 1000);
|
||||||
|
}, [filteredStats]);
|
||||||
|
|
||||||
if (isLoading) {
|
if (isLoading) {
|
||||||
return <p>Loading</p>;
|
return <p>Loading</p>;
|
||||||
}
|
}
|
||||||
@ -271,7 +275,7 @@ export function Stats() {
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{filteredStats.map((stat) => (
|
{limitedFilteredStats.map((stat) => (
|
||||||
<tr className="bg-white border-b" key={stat.id}>
|
<tr className="bg-white border-b" key={stat.id}>
|
||||||
<th
|
<th
|
||||||
scope="row"
|
scope="row"
|
||||||
@ -334,6 +338,11 @@ export function Stats() {
|
|||||||
))}
|
))}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
{filteredStats.length > limitedFilteredStats.length && (
|
||||||
|
<div className="relative px-6 py-3 bg-gray-50 text-sm text-slate-500 text-center">
|
||||||
|
Showing only the latest 1000 projects
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
Loading…
Reference in New Issue
Block a user