diff --git a/src/views/List.jsx b/src/views/List.jsx index 65b2e60..53deb2e 100644 --- a/src/views/List.jsx +++ b/src/views/List.jsx @@ -5,6 +5,7 @@ import { comparePurchaseUrgency } from '../api/firebase'; export function List({ data, listPath }) { const [searchTerm, setSearchTerm] = useState(''); + const listName = listPath.split('/')[1]; const navigate = useNavigate(); @@ -27,7 +28,7 @@ export function List({ data, listPath }) { }); filteredData.sort(comparePurchaseUrgency); - + console.log(listPath); return ( <> {!listPath ? ( @@ -40,6 +41,7 @@ export function List({ data, listPath }) { ) : null} {listPath && data.length === 0 ? ( <> +

{listName}

This list is currently empty. Click below to add your first item.

@@ -49,19 +51,22 @@ export function List({ data, listPath }) { ) : null} {data.length > 0 ? ( -
- - {searchTerm ? : null} -
+ <> +

{listName}

+
+ + {searchTerm ? : null} +
+ ) : null}