controls/variable-create-modal.ps1

function New-UDCreateVariableModal {
    
    Show-UDModal -Content {
        New-UDPageHeader -Text ("Creating new Variable")
        New-UDParagraph -Text "Specify a new Variable Name and Value"

        New-UDCard -Content{
            New-UDTextbox -Id "NewVariableTextBoxName" -Label "Name" -Type text
            New-UDTextbox -Id "NewVariableTextBoxValue" -Label "Value" -Type text

            New-UDSelect -Id "NewVariableSecretManagerSelect" -Label "Interval Type" -Option {
                
                New-UDSelectOption -Name "Every Minute" -Value "Every Minute" -Selected $true
            }

        }


        New-UDInput -Id "VariableCreateInput" -Endpoint {
            param (
                [Parameter(Mandatory = $true)]
                $VariableName,
                [Parameter(Mandatory = $true)]
                $VariableValue
            )
            
            New-UAVariable -Name $VariableName -Value $VariableValue
            Sync-UDElement -Id "VariablesGrid" -Broadcast
            Hide-UDModal
        }
    }
}