controls/variable-delete-modal.ps1

function New-UDDeleteVariableModal {
    
    param (
        [Parameter(Mandatory = $true)]
        $Variable
    )

    Show-UDModal -Content {
        New-UDPageHeader -Text ("Deleting Variable: $($Variable.Id)")
        New-UDParagraph -Text "Are you sure you wish to delete this Variable?"
        
        New-UDElement -Tag div -Attributes @{
            style = @{
                textAlign = "right"
            }
        } -Content {
        
            New-UDButton -Text "Confirm" -Icon check -OnClick {
                Remove-UAVariable -Variable $Variable
                Sync-UDElement -Id "VariablesGrid" -Broadcast
                Hide-UDModal
            }
        }
        
    }
}