controls/script-icon.ps1
function New-UDScriptIcon { param( $Script, $Id, [Switch]$NoSpan, [Switch]$IconOnly ) $icon = switch($Script.Status) { "Draft" { $StatusDisplay = "Draft" New-UDIcon -Icon firstdraft -Color gray -Size lg } "Pending_Review" { $StatusDisplay = "Pending Review" New-UDIcon -Icon user_friends -Color orange -Size lg } "Published" { $StatusDisplay = "Published" New-UDIcon -Icon file -Color green -Size lg } "Disabled" { $StatusDisplay = "Disabled" New-UDIcon -Icon times_circle -Color red -Size lg } } if ($NoSpan.IsPresent) { New-UDElement -Tag 'status' -Id $Id -Content { if($IconOnly.IsPresent) { $icon } else { $icon ($StatusDisplay) } } } else { New-UDElement -Tag 'span' -Id $Id -Content { if($IconOnly.IsPresent) { $icon } else { $icon ($StatusDisplay) } } } } |