What I'm trying to do is to display a message in a div tag, when the table is empty. Also, I show a circle when data is shown in the table, making that process button when it's delayed when the page is rendered? The problem is when there is no data in the table, the circle keeps showing and doesn't go off. I have put a condition if list.length > 0 shows the result and the circle.
<tbody>
{list?.length > 0 ? (
list?.map((list) => (
<tr key={list.id}>
<td >
<div>
{list.id}
</div>
</td>
<td >
<div>
{list.name}
</div>
</td>
<td>
<div>
{list.created}
</div>
</td>
</tr>
))
) : (
<tr>
<td colSpan={6}>
<div>
<svg
xmlns="http://www.w.org/200/svg"
fill="none"
viewBox="0 0 24 24"
>
<circle
className="opacity-25"
cx="12"
cy="12"
r="10"
stroke="currentColor"
strokeWidth="4"
></circle>
</svg>
</div>
</td>
</tr>
)}
How can I make it not show the circle when the table is empty, and also to display a "message" let's say, in a div tag?