Refactor: Simplify conditional rendering in FetchApi component

This commit is contained in:
M1000fr 2024-12-13 18:39:49 +01:00
parent 52fc2b5e07
commit bc880295c4

View File

@ -21,15 +21,11 @@ export const FetchApi = () => {
>
Fetch API
</button>
<div className="mt-4">
{date ? (
<p className="text-white">Server time: {date}</p>
) : (
<p className="text-white">
Click the button to fetch the API
</p>
)}
</div>
{date ? (
<p>Server time: {date}</p>
) : (
<p>Click the button to fetch the API</p>
)}
</div>
);
};