diff --git a/app/categories/[[...categories]]/page.tsx b/app/categories/[[...categories]]/page.tsx new file mode 100644 index 0000000..3c23ba3 --- /dev/null +++ b/app/categories/[[...categories]]/page.tsx @@ -0,0 +1,94 @@ +'use client'; + +import React, { useState } from 'react'; +import Image from 'next/image'; + +import { CategoriesSpreadsheet } from '@app/components/CategoriesSpreadsheet'; +import { faPlus} from '@fortawesome/free-solid-svg-icons' +import deleteIcon from "../../images/delete.png" +import editIcon from "../../images/edit.png" +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import { NameDropdown } from '@app/components/Dropdowns'; +import { InventorySpreadsheet } from '@app/components/InventorySpreadsheet'; + + +// export default function Categories() { +// FOR TESTING: + +const Categories: React.FC<{ onChange: (value: string) => void }> = ({ onChange }) => { + + const optionsArr = ["Bakery", "Dairy & Eggs", "Dry Goods", "Meat", "Prepared Foods", "Produce"] + const categoryItems = [["bread", "100"], ["cupcake", "100"]] + + const [showTable, setShowTable] = useState(false); + + const switchState = () => { + setShowTable(true) + } + + + + return ( +
+

Categories

+ +
+
+
+

Edit Category

+
+
+
+ +
+ {showTable && ( + delete Icon + )} + {showTable && ( + delete Icon + )} +
+ +
+ + {showTable && ()} + + +
+ + +
+
+
+ {showTable && ()} + {!showTable && (

Select a category.

)} + +
+
+
+
+ + ); +} + +export default Categories; + + +/* +pt-1 pb-1 px-1 mb-2 */ \ No newline at end of file diff --git a/app/components/CategoriesSpreadsheet.tsx b/app/components/CategoriesSpreadsheet.tsx new file mode 100644 index 0000000..3fc3883 --- /dev/null +++ b/app/components/CategoriesSpreadsheet.tsx @@ -0,0 +1,72 @@ +import React from "react"; +import Image from 'next/image'; +import deleteIcon from '../images/delete.png'; +import editIcon from "../images/edit.png"; +import arrowsIcon from "../images/upAndDownArrows.png"; + +interface CategoriesSpreadsheetProps { + inventoryItems: (string | number)[][]; +} + +export const CategoriesSpreadsheet: React.FC = ({ categoryItems = [] }) => { + console.log("categoryItems:", categoryItems); + + return( +
+ + + + + + + + + + {categoryItems.map((item, index) => ( + + {item.map((data, subIndex) => ( + + ))} + + + ))} + +
+
+

Item Name

+ arrows Icon + +
+
UnitsActions
+ {data} + + edit Icon + delete Icon + +
+
+ + ) +} \ No newline at end of file