Skip to content

Commit

Permalink
feat(hub): let the total number follow the user filter on hub page (#…
Browse files Browse the repository at this point in the history
…1208)

Because

- let the total number follow the user filter on hub page

This commit

- let the total number follow the user filter on hub page
  • Loading branch information
EiffelFly committed Jun 6, 2024
1 parent 88944b4 commit 4bdb6b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
2 changes: 1 addition & 1 deletion packages/toolkit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@instill-ai/toolkit",
"version": "0.92.0-rc.21",
"version": "0.92.0-rc.22",
"description": "Instill AI's frontend toolkit",
"repository": "https://github.com/instill-ai/design-system.git",
"bugs": "https://github.com/instill-ai/design-system/issues",
Expand Down
22 changes: 7 additions & 15 deletions packages/toolkit/src/view/hub/hub-view/Body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
Model,
Nullable,
Pipeline,
useHubStats,
useInfiniteModels,
useInfinitePipelines,
useInstillStore,
Expand Down Expand Up @@ -150,10 +149,6 @@ const ListSection: React.FC<{ tabValue: string; dataType?: DataType }> = ({
return all;
}, [models]);

const hubStats = useHubStats({
enabled: true,
});

const debouncedSetSearchCode = React.useMemo(
() =>
debounce((value: string) => {
Expand Down Expand Up @@ -210,19 +205,16 @@ const ListSection: React.FC<{ tabValue: string; dataType?: DataType }> = ({
{dataType === "pipelines" ? (
<React.Fragment>
Pipelines{" "}
{tabValue === "featured"
? hubStats.data?.number_of_featured_pipelines
: hubStats.data?.number_of_public_pipelines}
{pipelines.isSuccess && pipelines.data.pages?.[0]?.total_size
? pipelines.data.pages[0].total_size
: null}
</React.Fragment>
) : (
<React.Fragment>
Models
{models.isSuccess && models.data.pages?.[0]?.total_size ? (
<React.Fragment>
{" "}
{models.data.pages[0].total_size}
</React.Fragment>
) : null}
Models{" "}
{models.isSuccess && models.data.pages?.[0]?.total_size
? models.data.pages[0].total_size
: null}
</React.Fragment>
)}
</p>
Expand Down

0 comments on commit 4bdb6b5

Please sign in to comment.