Refactor: Simplify conditional rendering in FetchApi component
This commit is contained in:
parent
52fc2b5e07
commit
bc880295c4
@ -21,15 +21,11 @@ export const FetchApi = () => {
|
||||
>
|
||||
Fetch API
|
||||
</button>
|
||||
<div className="mt-4">
|
||||
{date ? (
|
||||
<p className="text-white">Server time: {date}</p>
|
||||
<p>Server time: {date}</p>
|
||||
) : (
|
||||
<p className="text-white">
|
||||
Click the button to fetch the API
|
||||
</p>
|
||||
<p>Click the button to fetch the API</p>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user