11"use client" ;
22
33import { useState , useEffect } from "react" ;
4- import { DotsThree , Eye , MagnifyingGlass , Plus } from "@phosphor-icons/react" ;
4+ import { MagnifyingGlass , Plus } from "@phosphor-icons/react" ;
55import { CgSpinner } from "react-icons/cg" ;
66import React from "react" ;
77import toast from "react-hot-toast" ;
88import { useRouter } from "next/navigation" ;
99import AddItemModal from "@/components/AddItemModal" ;
10- import { Menu , MenuButton , MenuItem , MenuItems } from "@headlessui/react" ;
11- import BaseTable , { extendTableHeader } from "@/components/BaseTable" ;
1210
1311interface UnallocatedItemData {
1412 title : string ;
@@ -19,6 +17,7 @@ interface UnallocatedItemData {
1917 quantityPerUnit : number ;
2018}
2119import { useFetch } from "@/hooks/useFetch" ;
20+ import BaseTable from "@/components/BaseTable" ;
2221
2322enum ExpirationFilterKey {
2423 ALL = "All" ,
@@ -217,7 +216,6 @@ export default function AdminUnallocatedItemsScreen() {
217216 "Expiration" ,
218217 "Unit type" ,
219218 "Qty/Unit" ,
220- extendTableHeader ( "Manage" , "w-12" ) ,
221219 ] }
222220 rows = { items . map ( ( item ) => ( {
223221 cells : [
@@ -228,36 +226,7 @@ export default function AdminUnallocatedItemsScreen() {
228226 ? new Date ( item . expirationDate ) . toLocaleDateString ( )
229227 : "N/A" ,
230228 item . unitType ,
231- item . quantityPerUnit ,
232- < div onClick = { ( e ) => e . stopPropagation ( ) } key = { 1 } >
233- < Menu as = "div" className = "float-right relative" >
234- < MenuButton >
235- < DotsThree weight = "bold" />
236- </ MenuButton >
237- < MenuItems className = "absolute right-0 z-10 mt-2 origin-top-right rounded-md bg-white ring-1 shadow-lg ring-black/5 w-max" >
238- < MenuItem
239- as = "button"
240- className = "flex w-full px-3 py-2 text-sm text-gray-700 hover:bg-gray-100"
241- onClick = { ( ) => {
242- router . push (
243- `/unallocatedItems/lineItems?${ new URLSearchParams ( {
244- title : item . title ,
245- type : item . type ,
246- unitType : item . unitType ,
247- quantityPerUnit : item . quantityPerUnit . toString ( ) ,
248- ...( item . expirationDate
249- ? { expirationDate : item . expirationDate }
250- : { } ) ,
251- } ) . toString ( ) } `
252- ) ;
253- } }
254- >
255- < Eye className = "inline-block mr-2" size = { 22 } />
256- View unique items
257- </ MenuItem >
258- </ MenuItems >
259- </ Menu >
260- </ div > ,
229+ item . quantityPerUnit
261230 ] ,
262231 onClick : ( ) => {
263232 router . push (
0 commit comments