diff --git a/frontend/src/pages/SubscriberList.tsx b/frontend/src/pages/SubscriberList.tsx index 400049e2..2b668c09 100644 --- a/frontend/src/pages/SubscriberList.tsx +++ b/frontend/src/pages/SubscriberList.tsx @@ -15,6 +15,7 @@ import { TableHead, TableRow, TablePagination, + TextField, } from "@mui/material"; export default function SubscriberList() { @@ -23,6 +24,7 @@ export default function SubscriberList() { const [data, setData] = useState([]); const [limit, setLimit] = useState(50); const [page, setPage] = useState(0); + const [searchTerm, setSearchTerm] = useState(""); useEffect(() => { console.log("get subscribers"); @@ -95,8 +97,25 @@ export default function SubscriberList() { navigation("/subscriber/" + subscriber.ueId + "/" + subscriber.plmnID); }; + const filteredData = data.filter((subscriber) => + subscriber.ueId?.toLowerCase().includes(searchTerm.toLowerCase()) || + subscriber.plmnID?.toLowerCase().includes(searchTerm.toLowerCase()) + ); + + const handleSearch = (event: React.ChangeEvent) => { + setSearchTerm(event.target.value); + }; + const tableView = ( + @@ -107,7 +126,7 @@ export default function SubscriberList() { - {data.map((row, index) => ( + {filteredData.map((row, index) => ( {row.plmnID} {row.ueId}