Skip to content

Commit

Permalink
[#171] Show pagination only if there are some records.
Browse files Browse the repository at this point in the history
  • Loading branch information
palagdan authored and blcham committed Oct 2, 2024
1 parent f13cae2 commit e95d3c7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/components/record/Records.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { Button, Card } from "react-bootstrap";
import { Alert, Button, Card } from "react-bootstrap";
import { injectIntl } from "react-intl";
import withI18n from "../../i18n/withI18n";
import { EXTENSION_CONSTANTS } from "../../constants/DefaultConstants";
Expand Down Expand Up @@ -70,12 +70,15 @@ class Records extends React.Component {
{this._getPanelTitle()}
</Card.Header>
<Card.Body>
{recordsLoaded.records && (
{recordsLoaded.records && recordsLoaded.records.length > 0 ? (
<>
<RecordTable {...this.props} />
<Pagination {...pagination} />
</>
) : (
<Alert variant="warning">No records</Alert>
)}

<ImportRecordsDialog
show={this.state.showImportDialog}
onSubmit={this.onImport}
Expand Down

0 comments on commit e95d3c7

Please sign in to comment.