fix empty state problems

This commit is contained in:
Nate Kelley 2025-03-20 11:38:54 -06:00
parent 0174daf77e
commit 11f2f3e550
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
13 changed files with 87 additions and 25 deletions

View File

@ -134,7 +134,12 @@ export const DatasetGroupDatasetsListContainer: React.FC<{
useRowClickSelectChange={false}
selectedRowKeys={selectedRowKeys}
onSelectChange={setSelectedRowKeys}
emptyState={<EmptyStateList text="No dataset groups found" />}
emptyState={useMemo(
() => (
<EmptyStateList text="No dataset groups found" />
),
[]
)}
/>
</InfiniteListContainer>
);

View File

@ -134,7 +134,12 @@ export const DatasetGroupDatasetGroupsListContainer: React.FC<{
useRowClickSelectChange={false}
selectedRowKeys={selectedRowKeys}
onSelectChange={setSelectedRowKeys}
emptyState={<EmptyStateList text="No dataset groups found" />}
emptyState={useMemo(
() => (
<EmptyStateList text="No dataset groups found" />
),
[]
)}
/>
</InfiniteListContainer>
);

View File

@ -138,7 +138,12 @@ export const DatasetGroupUsersListContainer: React.FC<{
useRowClickSelectChange={false}
selectedRowKeys={selectedRowKeys}
onSelectChange={setSelectedRowKeys}
emptyState={<EmptyStateList text="No dataset groups found" />}
emptyState={useMemo(
() => (
<EmptyStateList text="No dataset groups found" />
),
[]
)}
/>
</InfiniteListContainer>
);

View File

@ -54,7 +54,12 @@ export const ListPermissionGroupsComponent: React.FC<{
showHeader={true}
showSelectAll={false}
rowClassName="pl-[30px]!"
emptyState={<EmptyStateList text="No permission groups found" />}
emptyState={useMemo(
() => (
<EmptyStateList text="No permission groups found" />
),
[]
)}
/>
</InfiniteListContainer>
);

View File

@ -129,7 +129,12 @@ export const PermissionGroupDatasetGroupsListContainer: React.FC<{
useRowClickSelectChange={false}
selectedRowKeys={selectedRowKeys}
onSelectChange={setSelectedRowKeys}
emptyState={<EmptyStateList text="No dataset groups found" />}
emptyState={useMemo(
() => (
<EmptyStateList text="No dataset groups found" />
),
[]
)}
/>
</InfiniteListContainer>
);

View File

@ -134,7 +134,12 @@ export const PermissionGroupDatasetsListContainer: React.FC<{
useRowClickSelectChange={false}
selectedRowKeys={selectedRowKeys}
onSelectChange={setSelectedRowKeys}
emptyState={<EmptyStateList text="No dataset groups found" />}
emptyState={useMemo(
() => (
<EmptyStateList text="No dataset groups found" />
),
[]
)}
/>
</InfiniteListContainer>
);

View File

@ -133,7 +133,12 @@ export const PermissionGroupUsersListContainer: React.FC<{
useRowClickSelectChange={false}
selectedRowKeys={selectedRowKeys}
onSelectChange={setSelectedRowKeys}
emptyState={<EmptyStateList text="No dataset groups found" />}
emptyState={useMemo(
() => (
<EmptyStateList text="No dataset groups found" />
),
[]
)}
/>
</InfiniteListContainer>
);

View File

@ -44,7 +44,12 @@ export const UserAttributesListContainer: React.FC<{
showHeader={true}
showSelectAll={false}
useRowClickSelectChange={false}
emptyState={<EmptyStateList text="No datasets found" />}
emptyState={useMemo(
() => (
<EmptyStateList text="No datasets found" />
),
[]
)}
/>
</InfiniteListContainer>
);

View File

@ -130,7 +130,12 @@ export const UserDatasetsListContainer: React.FC<{
useRowClickSelectChange={false}
selectedRowKeys={selectedRowKeys}
onSelectChange={setSelectedRowKeys}
emptyState={<EmptyStateList text="No datasets found" />}
emptyState={useMemo(
() => (
<EmptyStateList text="No datasets found" />
),
[]
)}
/>
</InfiniteListContainer>
);

View File

@ -136,7 +136,12 @@ export const UserPermissionGroupsListContainer: React.FC<{
useRowClickSelectChange={false}
selectedRowKeys={selectedRowKeys}
onSelectChange={setSelectedRowKeys}
emptyState={<EmptyStateList text="No permission groups found" />}
emptyState={useMemo(
() => (
<EmptyStateList text="No permission groups found" />
),
[]
)}
/>
</InfiniteListContainer>
);

View File

@ -117,7 +117,12 @@ export const ChatItemsContainer: React.FC<{
columns={columns}
onSelectChange={onSelectChange}
selectedRowKeys={selectedRowKeys}
emptyState={<EmptyState loading={loading} type={type} />}
emptyState={useMemo(
() => (
<EmptyState loading={loading} type={type} />
),
[loading, type]
)}
/>
<ChatSelectedOptionPopup

View File

@ -84,19 +84,21 @@ export const DatasetListContent: React.FC<{
rows={rows}
selectedRowKeys={selectedRowKeys}
onSelectChange={setSelectedRowKeys}
emptyState={
!isFetchedDatasets ? (
<></>
) : (
<ListEmptyStateWithButton
isAdmin={isAdmin}
title="You don't have any datasets yet."
buttonText="New dataset"
description="Datasets help you organize your data. Datasets will appear here when you create them."
onClick={onClickEmptyState}
/>
)
}
emptyState={useMemo(
() =>
!isFetchedDatasets ? (
<></>
) : (
<ListEmptyStateWithButton
isAdmin={isAdmin}
title="You don't have any datasets yet."
buttonText="New dataset"
description="Datasets help you organize your data. Datasets will appear here when you create them."
onClick={onClickEmptyState}
/>
),
[isFetchedDatasets, isAdmin, onClickEmptyState]
)}
/>
<DatasetSelectedOptionPopup

View File

@ -116,7 +116,12 @@ export const MetricItemsContainer: React.FC<{
columns={columns}
onSelectChange={onSelectChange}
selectedRowKeys={selectedRowKeys}
emptyState={<EmptyState loading={loading} />}
emptyState={useMemo(
() => (
<EmptyState loading={loading} />
),
[loading]
)}
/>
<MetricSelectedOptionPopup