Skip to content

Commit ae70c64

Browse files
author
itsrennyman
committed
1 file modified
1 parent 187428d commit ae70c64

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/Presentation/TodoList.tsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { useFetchTodos } from "../Domain/UseCases/useFetchTodos";
2-
import { TodoDataSourceImpl } from "../Data/DataSources/TodoDataSource";
32
import { TodoRepositoryImpl } from "../Data/Repositories/TodoRepositoryImpl";
43
import { TodoLocalStorageDataSource } from "../Data/DataSources/Todo/TodoLocalStorageDataSource";
54

@@ -15,11 +14,17 @@ export function TodoList() {
1514
{isFetchTodosLoading ? (
1615
<div>Loading...</div>
1716
) : (
18-
<ul>
19-
{todos?.map((todo) => (
20-
<li key={todo.id}>{todo.title}</li>
21-
))}
22-
</ul>
17+
<>
18+
{todos.length === 0 ? (
19+
<div>No available Todos.</div>
20+
) : (
21+
<ul>
22+
{todos?.map((todo) => (
23+
<li key={todo.id}>{todo.title}</li>
24+
))}
25+
</ul>
26+
)}
27+
</>
2328
)}
2429
</fieldset>
2530
);

0 commit comments

Comments
 (0)