about summary refs log tree commit diff
path: root/MatrixRoomUtils.Web/Shared/RoomListComponents/RoomListCategory.razor
blob: 4be3c1f653d650ba1d5002d9eb68e20702c329de (plain) (blame)
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
@using MatrixRoomUtils.Core.StateEventTypes
@using MatrixRoomUtils.Core.StateEventTypes.Spec
<details>
    <summary>@roomType (@rooms.Count)</summary>
    @foreach (var room in rooms) {
        <div class="room-list-item">
            <RoomListItem RoomInfo="@room" ShowOwnProfile="@(roomType == "Room")"></RoomListItem>
            @if (room.StateEvents.Any(x => x.Type == "m.room.create")) {
                
            }
            <MatrixRoomUtils.Web.Shared.SimpleComponents.LinkButton href="@($"/Rooms/{room.Room.RoomId}/Timeline")">View timeline</MatrixRoomUtils.Web.Shared.SimpleComponents.LinkButton>
            <MatrixRoomUtils.Web.Shared.SimpleComponents.LinkButton href="@($"/Rooms/{room.Room.RoomId}/State/View")">View state</MatrixRoomUtils.Web.Shared.SimpleComponents.LinkButton>
            <MatrixRoomUtils.Web.Shared.SimpleComponents.LinkButton href="@($"/Rooms/{room.Room.RoomId}/State/Edit")">Edit state</MatrixRoomUtils.Web.Shared.SimpleComponents.LinkButton>
            
            @if (roomType == "Space") {
                <RoomListSpace Space="@room"></RoomListSpace>
            }
        </div>
    }
</details>
<br/>

@code {

    [Parameter]
    public KeyValuePair<string, List<RoomInfo>> Category { get; set; }
    
    [Parameter]
    public ProfileResponseEventData? GlobalProfile { get; set; }

    private string roomType => Category.Key;
    private List<RoomInfo> rooms => Category.Value;
    
}