All files / utils deviceToIconMap.tsx

100% Statements 97/97
100% Branches 1/1
100% Functions 1/1
100% Lines 97/97

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 1191x 1x 1x 1x 1x         1x                   1x 1x           1x 2x 2x 2x   2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x   2x 2x 2x 2x 2x   2x 2x 2x  
import { BsTv } from "react-icons/bs";
import { CgThermostat } from "react-icons/cg";
import { IoWalk } from "react-icons/io5";
import { LuHousePlug } from "react-icons/lu";
import {
	MdOutlineDoorbell,
	MdOutlineGasMeter,
	MdOutlineLightMode,
} from "react-icons/md";
import {
	PiDoorOpen,
	PiFan,
	PiGarageLight,
	PiLightbulbFilament,
	PiSecurityCamera,
	PiSiren,
	PiSpeakerHifi,
	PiThermometer,
} from "react-icons/pi";
import { RiDoorLockLine } from "react-icons/ri";
import {
	TbDeviceUnknownFilled,
	TbDropletExclamation,
	TbWindow,
} from "react-icons/tb";
 
export const deviceToIconMap = (iconSize: number) => {
	const activeColor = "#2cb1d4";
	const inactiveColor = "#8b8b8b";
	const size = iconSize;
 
	return {
		light: {
			active: <PiLightbulbFilament color={activeColor} size={size} />,
			inactive: <PiLightbulbFilament color={inactiveColor} size={size} />,
		},
		fan: {
			active: <PiFan color={activeColor} size={size} />,
			inactive: <PiFan color={inactiveColor} size={size} />,
		},
		thermostat: {
			active: <CgThermostat color={activeColor} size={size} />,
			inactive: <CgThermostat color={inactiveColor} size={size} />,
		},
		thermometer: {
			active: <PiThermometer color={activeColor} size={size} />,
			inactive: <PiThermometer color={inactiveColor} size={size} />,
		},
		temperature: {
			active: <PiThermometer color={activeColor} size={size} />,
			inactive: <PiThermometer color={inactiveColor} size={size} />,
		},
		lock: {
			active: <RiDoorLockLine color={activeColor} size={size} />,
			inactive: <RiDoorLockLine color={inactiveColor} size={size} />,
		},
		camera: {
			active: <PiSecurityCamera color={activeColor} size={size} />,
			inactive: <PiSecurityCamera color={inactiveColor} size={size} />,
		},
		speaker: {
			active: <PiSpeakerHifi color={activeColor} size={size} />,
			inactive: <PiSpeakerHifi color={inactiveColor} size={size} />,
		},
		doorbell: {
			active: <MdOutlineDoorbell color={activeColor} size={size} />,
			inactive: <MdOutlineDoorbell color={inactiveColor} size={size} />,
		},
		plug: {
			active: <LuHousePlug color={activeColor} size={size} />,
			inactive: <LuHousePlug color={inactiveColor} size={size} />,
		},
		tv: {
			active: <BsTv color={activeColor} size={size} />,
			inactive: <BsTv color={inactiveColor} size={size} />,
		},
		window: {
			active: <TbWindow color={activeColor} size={size} />,
			inactive: <TbWindow color={inactiveColor} size={size} />,
		},
		door: {
			active: <PiDoorOpen color={activeColor} size={size} />,
			inactive: <PiDoorOpen color={inactiveColor} size={size} />,
		},
		garage: {
			active: <PiGarageLight color={activeColor} size={size} />,
			inactive: <PiGarageLight color={inactiveColor} size={size} />,
		},
		buzzer: {
			active: <PiSiren color={activeColor} size={size} />,
			inactive: <PiSiren color={inactiveColor} size={size} />,
		},
		motion: {
			active: <IoWalk color={activeColor} size={size} />,
			inactive: <IoWalk color={inactiveColor} size={size} />,
		},
		photocell: {
			active: <MdOutlineLightMode color={activeColor} size={size} />,
			inactive: <MdOutlineLightMode color={inactiveColor} size={size} />,
		},
		gas: {
			active: <MdOutlineGasMeter color={activeColor} size={size} />,
			inactive: <MdOutlineGasMeter color={inactiveColor} size={size} />,
		},
		moisture: {
			active: <TbDropletExclamation color={activeColor} size={size} />,
			inactive: (
				<TbDropletExclamation color={inactiveColor} size={size} />
			),
		},
		default: {
			active: <TbDeviceUnknownFilled color={activeColor} size={size} />,
			inactive: (
				<TbDeviceUnknownFilled color={inactiveColor} size={size} />
			),
		},
	};
};