Skip to content

Commit

Permalink
feat(ui): display total contact count
Browse files Browse the repository at this point in the history
  • Loading branch information
Valik3201 committed Jan 23, 2024
1 parent f1ce057 commit 86d05b7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/components/ContactList.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import PropTypes from 'prop-types';
import { useState } from 'react';
import { ListGroup, Row, Col, Button } from 'react-bootstrap';
import { ListGroup, Row, Col, Button, Alert } from 'react-bootstrap';
import { ContactEditModal } from './ContactEditModal';

/**
Expand Down Expand Up @@ -65,6 +65,13 @@ export const ContactList = ({

return (
<>
{sortedContacts.length === 0 ? (
<Alert variant="danger">No contacts found. Please add contacts.</Alert>
) : (
<Alert variant="primary">
You have {sortedContacts.length} contacts.
</Alert>
)}
<ListGroup as="ul">
{sortedContacts.map(contact => (
<ContactListItem
Expand Down

0 comments on commit 86d05b7

Please sign in to comment.