@using NetinaShop.Domain.Dtos.ResponseDtos
<MudDialog DisableSidePadding="true" class="mx-auto">
    <DialogContent >
        <MudStack>
            <MudStack class="mx-10 mt-7 mb-5" Spacing="0">
                <MudStack Row="true">
                    <MudText Typo="Typo.h5" class="my-auto">ورژن جدید : </MudText>
                    <MudText Typo="Typo.h3" class="font-bold" Color="Color.Success">@AdminChangeLog.Version</MudText>
                </MudStack>
                <MudText Typo="Typo.body1">@AdminChangeLog.Description</MudText>
            </MudStack>
            <MudContainer>
                <MudTimeline TimelinePosition="TimelinePosition.Start" DisableModifiers="false">



                    <MudTimelineItem Color="Color.Info" Size="Size.Small">
                        <ItemOpposite>
                            <MudText Color="Color.Info" Typo="Typo.h5">1977</MudText>
                        </ItemOpposite>
                        <ItemContent>
                                <MudCard Outlined="true" Elevation="25">
                                <MudCardContent>
                                    <MudText Color="Color.Info" Typo="Typo.h6" GutterBottom="true">ویژگی های جدید</MudText>
                                    <MudStack Spacing="0" Row="true" class="flex-wrap">
                                        @foreach (var item in AdminChangeLog.Features)
                                        {
                                            <MudChip Variant="Variant.Outlined" Color="Color.Default">@item</MudChip>
                                        }
                                    </MudStack>
                                </MudCardContent>
                            </MudCard>
                        </ItemContent>
                    </MudTimelineItem>

                    <MudTimelineItem TimelineAlign="TimelineAlign.End" Color="Color.Error" Size="Size.Small">
                        <ItemOpposite>
                            <MudText Color="Color.Error" Typo="Typo.h5">1979</MudText>
                        </ItemOpposite>
                        <ItemContent>
                            <MudCard Outlined="true" Elevation="25">
                                <MudCardContent>
                                    <MudText Color="Color.Error" Typo="Typo.h6" GutterBottom="true">مشکلات رفع شده</MudText>
                                    <MudStack Spacing="0" Row="true" class="flex-wrap">
                                        @foreach (var item in AdminChangeLog.BugFixes)
                                        {
                                            <MudChip Variant="Variant.Outlined" Color="Color.Default">@item</MudChip>
                                        }
                                    </MudStack>
                                </MudCardContent>
                            </MudCard>
                        </ItemContent>
                    </MudTimelineItem>

                </MudTimeline>
            </MudContainer>
        </MudStack>
    </DialogContent>
    <DialogActions>
        <MudStack Row="true" class="w-full mx-4 mb-2">
            <MudButton class="w-full" Variant="Variant.Outlined" Size="Size.Large" Color="Color.Error" OnClick="Cancel">بستن</MudButton>
        </MudStack>
    </DialogActions>
</MudDialog>
@code {

    [CascadingParameter]
    MudDialogInstance MudDialog { get; set; }

    [Parameter]
    public AdminChangeLogResponseDto AdminChangeLog { get; set; } = new();

    void Cancel() => MudDialog.Cancel();

    protected override Task OnParametersSetAsync()
    {
        return base.OnParametersSetAsync();
    }

}
