-
-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7f4a037
commit 6115d06
Showing
2 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import DeviceIcon from "@/components/mobiflight/icons/DeviceIcon"; | ||
import { DeviceElementType, IDeviceItem } from "@/types"; | ||
import { IconTrash } from "@tabler/icons-react"; | ||
|
||
export type MobiFlightDeviceEditPanelProps = { | ||
device: IDeviceItem; | ||
}; | ||
|
||
export const MobiFlightDeviceEditPanel = ( | ||
props: MobiFlightDeviceEditPanelProps | ||
) => { | ||
const device = props.device; | ||
return ( | ||
<div className="w-full flex flex-col p-4 overflow-y-auto gap-2"> | ||
{(device?.Elements ?? []).map((element) => { | ||
return ( | ||
<div className="group flex flex-row gap-4 items-center hover:bg-slate-200 py-2 px-4 rounded-md cursor-pointer border-2 border-slate-200" key={element.Id}> | ||
<DeviceIcon className="w-8 h-8" variant={element.Type as DeviceElementType}></DeviceIcon> | ||
<div className="grow">{element.Name}</div> | ||
<div className="group-hover:opacity-100 opacity-0"><IconTrash className="text-gray-400"></IconTrash></div> | ||
</div> | ||
); | ||
})} | ||
</div> | ||
); | ||
}; | ||
|
||
export default MobiFlightDeviceEditPanel; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import DeviceIcon from "@/components/mobiflight/icons/DeviceIcon"; | ||
import { DeviceElementTypes } from "@/types/deviceElements"; | ||
|
||
const DeviceSelection = () => { | ||
const availableDeviceTypes = DeviceElementTypes; | ||
|
||
return ( | ||
<div className="flex flex-row flex-wrap gap-4"> | ||
{availableDeviceTypes.map((deviceType) => { | ||
return ( | ||
<div | ||
key={deviceType} | ||
className="h-24 w-24 group flex flex-col gap-1 items-center justify-center hover:bg-slate-200 py-2 px-4 rounded-md cursor-pointer border-2 border-slate-200" | ||
> | ||
<DeviceIcon className="w-12 h-12" variant={deviceType}></DeviceIcon> | ||
<div className="">{deviceType}</div> | ||
</div> | ||
); | ||
})} | ||
</div> | ||
); | ||
}; | ||
|
||
export default DeviceSelection; |