@namespace ThingsGateway.Gateway.Razor

@using ThingsGateway.Blazor.Diagrams.Components.Renderers
<div class="custom-node @(Node.Selected ? " selected" : "")">
    <div class="card" style="width: 250px;">
        <div class="card-body">
            <h6 class="card-title mb-2">@Localizer[Node.Title]</h6>
            <div class="form-group">
                <input type="number" class="form-control"
                @bind-value="Node.Number"
                placeholder="@Localizer[Node.Placeholder]"
                @onpointerdown:stopPropagation
                @onpointerup:stopPropagation
                @onpointermove:stopPropagation />
            </div>
        </div>
    </div>

    @foreach (var port in Node.Ports)
    {
        <PortRenderer @key="port" Port="port"></PortRenderer>
    }
</div>

@code {
    [Inject]
    IStringLocalizer<ThingsGateway.Gateway.Razor._Imports> Localizer { get; set; }

    [Parameter]
    public NumberNode Node { get; set; }
}
