Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions nextjs/src/features/schemas/components/SchemaList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ const SchemaList = (props: {
if (organizationId) {
getSchemaList(schemaListAPIParameter, allSchemaFlag)
}
}, [schemaListAPIParameter.page])
}, [schemaListAPIParameter.page, schemaListAPIParameter.allSearch, schemaListAPIParameter.search])

const onSearch = (event: ChangeEvent<HTMLInputElement>): void => {
const inputValue = event.target.value
Expand Down Expand Up @@ -426,7 +426,7 @@ const SchemaList = (props: {
</Button>
</div>

{loading ? (
{loading && (
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-2">
{[...Array(4)].map((_, idx) => (
<div key={idx} className="space-y-3 rounded-lg p-4 shadow-sm">
Expand All @@ -438,7 +438,9 @@ const SchemaList = (props: {
</div>
))}
</div>
) : schemaList.length ? (
)}

{loading ? null : schemaList.length ? (
<>
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-2">
{schemaList.map((element) => (
Expand All @@ -464,7 +466,7 @@ const SchemaList = (props: {
</div>
))}
</div>
{totalItem > itemPerPage && (
{totalItem > itemPerPage && schemaList.length === itemPerPage && (
<div className="mt-6 flex justify-end">
<Pagination className="m-0 w-fit">
<PaginationContent>
Expand Down
Loading