@using VisionBuilder.UI.Common
@implements IDisposable

<div class="single-camera-control">
    <div class="camera-header">
        <div class="camera-header-preview">
            <span class="camera-label">@_cameraLabel</span>
        </div>
        <div class="camera-header-errors">
            <span class="errors-label">Errors</span>
        </div>
        <div class="camera-header-stats"></div>
        <div class="camera-header-buttons"></div>
    </div>

    <div class="camera-body">
        <div class="camera-preview-area">
            <PreviewWindow ViewModel="@ViewModel?.PreviewVm" />
        </div>
        <div class="camera-divider"></div>
        <div class="camera-errors-area">
            <ErrorPreview ViewModel="@ViewModel?.ErrorsVm" />
        </div>
        <div class="camera-divider"></div>
        <div class="camera-stats-area">
            <Stats ViewModel="@ViewModel?.StatisticsVm" />
        </div>
        <div class="camera-buttons-area">
            <div class="camera-buttons-stack">
                <MudButton Variant="Variant.Outlined" Color="Color.Primary" FullWidth="true"
                           Class="camera-btn"
                           Disabled="@(!_canSelectRecipe)"
                           OnClick="@OnSelectRecipe">
                    @_currentRecipeName
                </MudButton>
                <MudButton Variant="Variant.Filled" Color="Color.Primary" FullWidth="true"
                           Class="camera-btn"
                           Style="@(_canStart ? null : "display:none")"
                           Disabled="@(!_canStart)"
                           OnClick="@OnStart">
                    Start
                </MudButton>
                <MudButton Variant="Variant.Filled" Color="Color.Primary" FullWidth="true"
                           Class="camera-btn"
                           Style="@(_canStop ? null : "display:none")"
                           Disabled="@(!_canStop)"
                           OnClick="@OnStop">
                    Stop
                </MudButton>
                <MudButton Variant="Variant.Outlined" Color="Color.Primary" FullWidth="true"
                           Class="camera-btn"
                           Style="@(_showPauseButton && _canPause ? null : "display:none")"
                           Disabled="@(!_canPause)"
                           OnClick="@OnPause">
                    Pause
                </MudButton>
                <MudButton Variant="Variant.Outlined" Color="Color.Primary" FullWidth="true"
                           Class="camera-btn"
                           Style="@(_showPauseButton && _canResume ? null : "display:none")"
                           Disabled="@(!_canResume)"
                           OnClick="@OnResume">
                    Resume
                </MudButton>
                <MudButton Variant="Variant.Outlined" Color="Color.Primary" FullWidth="true"
                           Class="camera-btn"
                           Style="@(_canHotReload ? null : "display:none")"
                           Disabled="@(!_canHotReload)"
                           OnClick="@OnHotReload">
                    Hot Reload
                </MudButton>
            </div>
        </div>
    </div>
</div>
