loaderUI
This commit is contained in:
parent
7cbd74fc14
commit
21290040cb
|
|
@ -4,6 +4,7 @@ import api from '../../config/api';
|
||||||
import ContactFormModal, { ContactData } from './ContactsFormModal';
|
import ContactFormModal, { ContactData } from './ContactsFormModal';
|
||||||
import { Bounce, toast } from 'react-toastify';
|
import { Bounce, toast } from 'react-toastify';
|
||||||
import { IoMdAdd } from 'react-icons/io';
|
import { IoMdAdd } from 'react-icons/io';
|
||||||
|
import LoaderUi from '../../helper/LoaderUi';
|
||||||
|
|
||||||
type ContactSchema = [{
|
type ContactSchema = [{
|
||||||
id: number,
|
id: number,
|
||||||
|
|
@ -25,6 +26,7 @@ const Contacts = () => {
|
||||||
console.log("editJsonData", editJsonData)
|
console.log("editJsonData", editJsonData)
|
||||||
|
|
||||||
const fetchContacts = async () => {
|
const fetchContacts = async () => {
|
||||||
|
setLoading(true)
|
||||||
try {
|
try {
|
||||||
const res = await api.get(`/api/accounts/${activeAccountId}/contacts`);
|
const res = await api.get(`/api/accounts/${activeAccountId}/contacts`);
|
||||||
setContacts(res.data.content || []);
|
setContacts(res.data.content || []);
|
||||||
|
|
@ -140,7 +142,7 @@ const Contacts = () => {
|
||||||
<tbody className="divide-y divide-gray-200">
|
<tbody className="divide-y divide-gray-200">
|
||||||
{loading ? (
|
{loading ? (
|
||||||
<tr>
|
<tr>
|
||||||
<td colSpan="4" className="text-center py-4">Loading...</td>
|
<td colSpan="4" className="relative h-100"><LoaderUi/></td>
|
||||||
</tr>
|
</tr>
|
||||||
) : contacts.length === 0 ? (
|
) : contacts.length === 0 ? (
|
||||||
<tr>
|
<tr>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue