telelogs 0.3.0

Telelogs desktop app: a native log viewer for Docker and Kubernetes
use gpui_kit::*;

/// Phosphor icons bundled in `assets/icons` (MIT, see LICENSE-PHOSPHOR).
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Icon {
    Archive,
    ArrowClockwise,
    ArrowElbowDownLeft,
    ArrowLineDown,
    ArrowUpRight,
    ArrowsClockwise,
    ArrowsDownUp,
    BracketsCurly,
    Broadcast,
    Broom,
    CaretDown,
    CaretRight,
    CaretUpDown,
    Check,
    CheckboxCheck,
    CircleHalf,
    ClockCounterClockwise,
    Copy,
    CrosshairSimple,
    Cube,
    Cylinder,
    Database,
    DotsThree,
    EnvelopeSimple,
    Feather,
    FunnelSimple,
    FunnelSimpleX,
    GearSix,
    GithubLogo,
    HardDrive,
    HardDrives,
    LockSimple,
    MagnifyingGlass,
    Memory,
    Moon,
    Pause,
    Plugs,
    PlugsConnected,
    Plus,
    Pulse,
    Rows,
    SteeringWheel,
    Sun,
    UsersThree,
    X,
    XCircle,
}

impl Icon {
    pub fn path(self) -> &'static str {
        match self {
            Icon::Archive => "icons/archive.svg",
            Icon::ArrowClockwise => "icons/arrow-clockwise.svg",
            Icon::ArrowElbowDownLeft => "icons/arrow-elbow-down-left.svg",
            Icon::ArrowLineDown => "icons/arrow-line-down.svg",
            Icon::ArrowUpRight => "icons/arrow-up-right.svg",
            Icon::ArrowsClockwise => "icons/arrows-clockwise.svg",
            Icon::ArrowsDownUp => "icons/arrows-down-up.svg",
            Icon::BracketsCurly => "icons/brackets-curly.svg",
            Icon::Broadcast => "icons/broadcast.svg",
            Icon::Broom => "icons/broom.svg",
            Icon::CaretDown => "icons/caret-down.svg",
            Icon::CaretRight => "icons/caret-right.svg",
            Icon::CaretUpDown => "icons/caret-up-down.svg",
            Icon::Check => "icons/check.svg",
            Icon::CheckboxCheck => "icons/checkbox-check.svg",
            Icon::CircleHalf => "icons/circle-half.svg",
            Icon::ClockCounterClockwise => "icons/clock-counter-clockwise.svg",
            Icon::Copy => "icons/copy.svg",
            Icon::CrosshairSimple => "icons/crosshair-simple.svg",
            Icon::Cube => "icons/cube.svg",
            Icon::Cylinder => "icons/cylinder.svg",
            Icon::Database => "icons/database.svg",
            Icon::DotsThree => "icons/dots-three.svg",
            Icon::EnvelopeSimple => "icons/envelope-simple.svg",
            Icon::Feather => "icons/feather.svg",
            Icon::FunnelSimple => "icons/funnel-simple.svg",
            Icon::FunnelSimpleX => "icons/funnel-simple-x-light.svg",
            Icon::GearSix => "icons/gear-six.svg",
            Icon::GithubLogo => "icons/github-logo.svg",
            Icon::HardDrive => "icons/hard-drive.svg",
            Icon::HardDrives => "icons/hard-drives.svg",
            Icon::LockSimple => "icons/lock-simple.svg",
            Icon::MagnifyingGlass => "icons/magnifying-glass.svg",
            Icon::Memory => "icons/memory.svg",
            Icon::Moon => "icons/moon.svg",
            Icon::Pause => "icons/pause.svg",
            Icon::Plugs => "icons/plugs.svg",
            Icon::PlugsConnected => "icons/plugs-connected.svg",
            Icon::Plus => "icons/plus.svg",
            Icon::Pulse => "icons/pulse.svg",
            Icon::Rows => "icons/rows.svg",
            Icon::SteeringWheel => "icons/steering-wheel.svg",
            Icon::Sun => "icons/sun.svg",
            Icon::UsersThree => "icons/users-three.svg",
            Icon::X => "icons/x.svg",
            Icon::XCircle => "icons/x-circle.svg",
        }
    }
}

pub fn icon(icon: Icon, size: f32, color: Hsla) -> Svg {
    svg().path(icon.path()).size(px(size)).flex_none().text_color(color)
}