@@ -10,7 +10,7 @@ import {
1010 useTheme ,
1111 TextField ,
1212} from "@mui/material" ;
13- import { DragIndicator } from "@mui/icons-material" ;
13+ import { DragIndicator , Apps } from "@mui/icons-material" ;
1414import { combine } from "@atlaskit/pragmatic-drag-and-drop/combine" ;
1515import {
1616 draggable ,
@@ -28,8 +28,8 @@ import { ApplicationsContext } from "../../contexts/ApplicationsProvider";
2828import { DashboardGroup } from "../../types" ;
2929
3030interface DrawerItemProps {
31- /** The item object containing the title, id, and icon . */
32- item : { title : string ; id : string ; icon : React . ComponentType } ;
31+ /** The item object containing the title, id, and the appType . */
32+ item : { title : string ; id : string ; type : string } ;
3333 /** The index of the item. */
3434 index : number ;
3535 /** The title of the group. */
@@ -52,7 +52,7 @@ interface DrawerItemProps {
5252 * @returns The rendered JSX for the drawer item.
5353 */
5454export default function DrawerItem ( {
55- item : { title, id, icon } ,
55+ item : { title, id, type } ,
5656 index,
5757 groupTitle,
5858 renamingItemId,
@@ -69,7 +69,10 @@ export default function DrawerItem({
6969 // Represents the closest edge to the mouse cursor
7070 const [ closestEdge , setClosestEdge ] = useState < Edge | null > ( null ) ;
7171
72- const [ , , , appId , setCurrentAppId ] = useContext ( ApplicationsContext ) ;
72+ const [ , , appList , appId , setCurrentAppId ] = useContext ( ApplicationsContext ) ;
73+ const { icon } = appList . find ( ( app ) => app . name === type ) || {
74+ icon : Apps ,
75+ } ;
7376
7477 useEffect ( ( ) => {
7578 if ( ! dragRef . current || ! handleRef . current ) return ;
@@ -184,7 +187,7 @@ export default function DrawerItem({
184187 < ListItemButton
185188 disableGutters
186189 key = { title }
187- onClick = { ( ) => setCurrentAppId ( id ) } //setParam ("appId", id) }
190+ onClick = { ( ) => setCurrentAppId ( id ) }
188191 sx = { { pl : 2 , borderRadius : 2 , pr : 1 } }
189192 ref = { dragRef }
190193 selected = { appId === id }
0 commit comments