<script lang="ts">
	import DeviceIcon from "$lib/components/DeviceIcon.svelte";
import Lamp, { DARK_COLOR } from "$lib/components/Lamp.svelte";
	import Toolbar from "$lib/components/Toolbar.svelte";
	import { getStateContext } from "$lib/contexts/StateContext.svelte";
	import { rgb } from "$lib/models/color";

  const {deviceList} = getStateContext();
</script>

<div class="page">
  {#each $deviceList as device (device.id) }
    <Lamp device={device} />
  {/each}
</div>
<div class="page" style="font-size: 8em">
  <DeviceIcon name="generic_ball" brightColor={rgb(0.517,0.537,1.000)} darkColor={DARK_COLOR} />
  <DeviceIcon name="generic_boob" brightColor={rgb(0.517,0.537,1.000)} darkColor={DARK_COLOR} />
  <DeviceIcon name="generic_lamp" brightColor={rgb(0.667,0.750,1.000)} darkColor={DARK_COLOR} />
  <DeviceIcon name="generic_strip" brightColor={rgb(0.667,0.750,1.000)} darkColor={DARK_COLOR} />
  <DeviceIcon name="hue_adore_tube" brightColor={rgb(1,1,0)} darkColor={DARK_COLOR} />
  <DeviceIcon name="hue_signe" brightColor={rgb(0.300,1.000,0.300)} darkColor={DARK_COLOR} />
  <DeviceIcon name="hue_dimmerswitch" brightColor={rgb(0.517,0.537,1.000)} darkColor={DARK_COLOR} />
  <DeviceIcon name="hue_playbar" brightColor={rgb(1,0,1)} darkColor={DARK_COLOR} />
  <DeviceIcon name="hue_motionsensor" brightColor={rgb(1,1,1)} darkColor={DARK_COLOR} />
  <DeviceIcon name="hue_lightbulb_e27" brightColor={rgb(1,1,1)} darkColor={DARK_COLOR} />
  <DeviceIcon name="hue_lightbulb_e14" brightColor={rgb(1,1,1)} darkColor={DARK_COLOR} />
  <DeviceIcon name="hue_lightbulb_gu10" brightColor={rgb(1,1,1)} darkColor={DARK_COLOR} />
</div>
<Toolbar />

<style>
  div.page {
    margin: 0 auto;
    width: 100ch;
    max-width: 95%;
    margin-top: 1em;
    font-size: 2em;
  
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
  }
</style>