Ui/DesignSystem/PlotterSurface.razor

The PlotterSurface component provides a styled UI container. It accepts parameters like Title, Kind, Raised, and Fill to customize its appearance and structure.

@namespace CitySim.DesignSystem
@using Sandbox.UI
@using CitySim.Punchboard
@inherits Panel

<root class="plotter-surface @(Raised || Kind == PbPanelKind.Raised ? "raised" : "") @(Kind == PbPanelKind.Tooltip ? "tooltip-surface" : "") @(Fill ? "fill" : "")">
    <div class="plotter-surface-paper"></div>
    <div class="plotter-surface-frame"></div>
    @if ( !string.IsNullOrEmpty( Title ) )
    {
        <div class="plotter-surface-title">@(GameText.Plain(Title))</div>
    }
    <div class="plotter-surface-body">@ChildContent</div>
    @if (Corner) { <div class="plotter-surface-corner"></div> }
</root>

@code
{
    [Parameter] public new RenderFragment ChildContent { get; set; }
    [Parameter] public string Title { get; set; }
    [Parameter] public PbPanelKind Kind { get; set; } = PbPanelKind.Standard;
    [Parameter] public bool Corner { get; set; }
    [Parameter] public bool Raised { get; set; }
    [Parameter] public bool Fill { get; set; }
    protected override int BuildHash() => HashCode.Combine(GameText.LanguageCode, HashCode.Combine( Title, Raised, Fill, Kind, Corner ));
}