File tree Expand file tree Collapse file tree 2 files changed +26
-19
lines changed Expand file tree Collapse file tree 2 files changed +26
-19
lines changed Original file line number Diff line number Diff line change 11import "./App.css" ;
2- import TodoRowItem from "./components/TodoRowItem " ;
2+ import TodoTable from "./components/TodoTable " ;
33
44function App ( ) {
55 const todos = [
@@ -13,24 +13,7 @@ function App() {
1313 < div className = "card" >
1414 < div className = "card-header" > Your Todo's</ div >
1515 < div className = "card-body" >
16- < table className = "table table-hover" >
17- < thead >
18- < tr >
19- < th scope = "col" > #</ th >
20- < th scope = "col" > Description</ th >
21- < th scope = "col" > Assigned</ th >
22- </ tr >
23- </ thead >
24- < tbody >
25- { todos . map ( ( todo ) => (
26- < TodoRowItem
27- rowNumber = { todo . rowNumber }
28- rowDescription = { todo . rowDescription }
29- rowAssigned = { todo . rowAssigned }
30- />
31- ) ) }
32- </ tbody >
33- </ table >
16+ < TodoTable todos = { todos } />
3417 </ div >
3518 </ div >
3619 </ div >
Original file line number Diff line number Diff line change 1+ import TodoRowItem from "./TodoRowItem" ;
2+
3+ export default function TodoTable ( props ) {
4+ return (
5+ < table className = "table table-hover" >
6+ < thead >
7+ < tr >
8+ < th scope = "col" > #</ th >
9+ < th scope = "col" > Description</ th >
10+ < th scope = "col" > Assigned</ th >
11+ </ tr >
12+ </ thead >
13+ < tbody >
14+ { props . todos . map ( ( todo ) => (
15+ < TodoRowItem
16+ rowNumber = { todo . rowNumber }
17+ rowDescription = { todo . rowDescription }
18+ rowAssigned = { todo . rowAssigned }
19+ />
20+ ) ) }
21+ </ tbody >
22+ </ table >
23+ ) ;
24+ }
You can’t perform that action at this time.
0 commit comments