@page "/Settings"
@using Blazorise.Components;
@using Elektrifikatsiya.Models;
@using System.Net
<Row Style="width: 100%; height: 100%">
    <Column ColumnSize="ColumnSize.Is4">
        <Bar Breakpoint="Breakpoint.Desktop"
             Background="Background.White"
             ThemeContrast="ThemeContrast.None"
             Shadow="Shadow.Remove"
             Border="Border.Is1.RoundedTop">
            <BarBrand>
                Plugs
            </BarBrand>
        </Bar>
        <ListView TItem="Device"
                  Data="@plugs"
                  TextField="@(()=>(""))"
                  ValueField="@(()=>(""))"
                  Style="border-radius: 0px 0px"
                  Height="100%"
                  MaxHeight="90%">
            <ItemTemplate>
                <ListGroupItem Border="Border.OnBottom">
                    <Row>
                        <Column ColumnSize="ColumnSize.Is8">
                            <Row>
                                <Column ColumnSize="ColumnSize.Is7">
                                    <Heading Size="HeadingSize.Is6" Margin="Margin.Is1.FromBottom">@context.Item.Name</Heading>
                                </Column>
                            </Row>
                            <Row>
                                <Column>
                                    <Small>User: @context.Item.User</Small>
                                    <br />
                                    <Small>Room: @context.Item.Room</Small>
                                </Column>
                                <Column ColumnSize="ColumnSize.Is5">
                                    <Paragraph Margin="Margin.Is1.OnY">@context.Item.PowerUsage W</Paragraph>
                                </Column>
                            </Row>
                        </Column>
                        <Column ColumnSize="ColumnSize.Is4">
                            <Button Position="Position.Absolute.Top.Is50.Start.Is50.Translate.Middle" Color="Color.Dark" Outline>
                                <BarIcon IconName="IconName.Bolt" />
                            </Button>
                        </Column>
                    </Row>
                </ListGroupItem>
            </ItemTemplate>
        </ListView>
    </Column>
</Row>


@code {


    List<Device> plugs = new List<Device>() { new Device("ffff:ffff:ffff:ffff", "Josne", IPAddress.Broadcast, new User("Joe", "qiowruioewjfopa", Role.Admin), "Raum"), new Device("ffff:ffff:ffff:ffff", "Josne", IPAddress.Broadcast, new User("Joe", "Josne", Role.Admin), "Raum"), new Device("ffff:ffff:ffff:ffff", "Josne", IPAddress.Broadcast, new User("Joe", "qiowruioewjfopa", Role.Admin), "Raum"), };

}