|
1 | 1 | import React, { useState } from 'react';
|
2 | 2 | import { useEnsureListPath, useUrgency } from '../hooks';
|
3 | 3 | import { getUrgency } from '../utils/urgencyUtils';
|
4 |
| -import { List as UnorderedList } from '@mui/material'; |
| 4 | +import { List as UnorderedList, Box, Grid } from '@mui/material'; |
5 | 5 | import { ListItem, AddItems, TextInputElement } from '../components';
|
6 | 6 |
|
7 | 7 | // React.memo is needed to prevent unnecessary re-renders of the List component
|
@@ -40,17 +40,31 @@ export const List = React.memo(function List({ data, listPath }) {
|
40 | 40 | ) : (
|
41 | 41 | <>
|
42 | 42 | <p>{listName}</p>
|
| 43 | + <Box sx={{ flexGrow: 1 }}> |
| 44 | + <Grid |
| 45 | + container |
| 46 | + spacing={8} |
| 47 | + columns={16} |
| 48 | + justifyContent="space-between" |
| 49 | + > |
| 50 | + <Grid item size={{ xs: 2, sm: 4, md: 4 }}> |
| 51 | + <AddItems items={data} /> |
| 52 | + </Grid> |
| 53 | + <Grid item size={{ xs: 2, sm: 4, md: 4 }}> |
| 54 | + <form onSubmit={(event) => event.preventDefault()}> |
| 55 | + <TextInputElement |
| 56 | + id="search-item" |
| 57 | + type="search" |
| 58 | + placeholder="Search Item..." |
| 59 | + required={true} |
| 60 | + onChange={handleTextChange} |
| 61 | + label="Search Item:" |
| 62 | + /> |
| 63 | + </form> |
| 64 | + </Grid> |
| 65 | + </Grid> |
| 66 | + </Box> |
43 | 67 |
|
44 |
| - <form onSubmit={(event) => event.preventDefault()}> |
45 |
| - <TextInputElement |
46 |
| - id="search-item" |
47 |
| - type="search" |
48 |
| - placeholder="Search Item..." |
49 |
| - required={true} |
50 |
| - onChange={handleTextChange} |
51 |
| - label="Search Item:" |
52 |
| - /> |
53 |
| - </form> |
54 | 68 | <UnorderedList>
|
55 | 69 | {filteredItems.map((item) => {
|
56 | 70 | const itemUrgencyStatus = getUrgency(item.name, urgencyObject);
|
|
0 commit comments