controls/script-delete-modal.ps1

function New-UDDeleteScriptModal {
    
    param (
        [Parameter(Mandatory = $true)]
        $Script
    )

    Show-UDModal -Content {
        New-UDPageHeader -Text ("Deleting Script: $($Script.Name)")
        New-UDParagraph -Text "Are you sure you wish to delete this script?"
        
        New-UDElement -Tag div -Attributes @{
            style = @{
                textAlign = "right"
            }
        } -Content {

            New-UDButton -Text "Confirm" -Icon check -OnClick {
                Remove-UAScript -Script $Script
                Sync-UDElement -Id "ScriptsGrid" -Broadcast
                Hide-UDModal
            }
        }
    }
}