use crate::api::AnytypeColor;
use serde::Deserialize;
use serde_json::{Map, Value};
#[derive(Debug)]
pub struct Icon {
pub format: IconFormat,
pub emoji: String,
pub file: String,
pub name: IconName,
pub color: AnytypeColor,
}
impl Default for Icon {
fn default() -> Self {
Icon {
format: IconFormat::Null,
emoji: "".to_string(),
file: "".to_string(),
name: IconName::Undefined,
color: AnytypeColor::Undefined,
}
}
}
impl Clone for Icon {
fn clone(&self) -> Self {
Icon {
format: self.format.clone(),
emoji: self.emoji.clone(),
file: self.file.clone(),
name: self.name.clone(),
color: self.color.clone(),
}
}
}
impl Icon {
pub fn emoji(emoji: &str) -> Self {
Icon {
format: IconFormat::Emoji,
emoji: emoji.to_string(),
file: "".to_string(),
name: IconName::Warning, color: AnytypeColor::Undefined, }
}
pub fn file(file: &str) -> Self {
Icon {
format: IconFormat::File,
emoji: "".to_string(),
file: file.to_string(),
name: IconName::Warning, color: AnytypeColor::Undefined, }
}
pub fn icon(name: IconName, color: AnytypeColor) -> Self {
Icon {
format: IconFormat::Icon,
emoji: "".to_string(),
file: "".to_string(),
name,
color,
}
}
pub fn to_json(&self) -> Value {
let mut icon_values = Map::new();
icon_values.insert("color".to_string(), Value::String("blue".to_string()));
match self.format {
IconFormat::Emoji => {
icon_values.insert("format".to_string(), Value::String(self.format.to_string()));
icon_values.insert("emoji".to_string(), Value::String(self.emoji.clone()));
}
IconFormat::File => {
icon_values.insert("format".to_string(), Value::String(self.format.to_string()));
icon_values.insert("file".to_string(), Value::String(self.file.clone()));
}
IconFormat::Icon => {
icon_values.insert("format".to_string(), Value::String(self.format.to_string()));
icon_values.insert("name".to_string(), Value::String(self.name.to_string()));
icon_values.insert("color".to_string(), Value::String(self.color.to_string()));
}
_ => {}
}
Value::Object(icon_values)
}
pub fn from_json(json: Value) -> Option<Icon> {
if json == Value::Null {
return None;
} else {
let format = json["format"].as_str().unwrap();
match format {
"icon" => {
let color = json["color"].as_str().unwrap();
let name = json["name"].as_str().unwrap();
return Some(Icon::icon(
IconName::from_str(name),
AnytypeColor::from_str(color),
));
}
"emoji" => {
let emoji = json["emoji"].as_str().unwrap();
return Some(Icon::emoji(emoji));
}
"file" => {
let file = json["file"].as_str().unwrap();
return Some(Icon::file(file));
}
_ => {
return None;
}
}
}
}
}
#[derive(Deserialize, Debug)]
pub struct AnytypeIcon {
pub format: String,
pub emoji: Option<String>,
pub file: Option<String>,
pub color: Option<String>,
pub name: Option<String>,
}
impl AnytypeIcon {
pub fn to_icon(a_icon: AnytypeIcon) -> Icon {
let emoji = match a_icon.emoji {
Some(e) => e.to_string(),
None => "".to_string(),
};
let file = match a_icon.file {
Some(f) => f.to_string(),
None => "".to_string(),
};
let name = match a_icon.name {
Some(n) => IconName::from_str(&n),
None => IconName::Warning,
};
let color = match a_icon.color {
Some(c) => AnytypeColor::from_str(&c),
None => AnytypeColor::Undefined, };
let format = match a_icon.format.as_str() {
"emoji" => IconFormat::Emoji,
"icon" => IconFormat::Icon,
"file" => IconFormat::File,
_ => IconFormat::Null,
};
Icon {
format,
emoji,
file,
name,
color,
}
}
}
#[derive(Debug, Clone, Copy)]
pub enum IconFormat {
Emoji,
Icon,
File,
Null,
}
impl IconFormat {
pub fn to_string(&self) -> String {
match self {
IconFormat::Emoji => "emoji".to_string(),
IconFormat::File => "file".to_string(),
IconFormat::Icon => "icon".to_string(),
IconFormat::Null => "undefined".to_string(),
}
}
}
#[derive(Debug, Clone, Copy)]
pub enum IconName {
Accessibility,
AddCircle,
Airplane,
Alarm,
Albums,
AlertCircle,
AmericanFootball,
Analytics,
Aperture,
Apps,
Archive,
ArrowBackCircle,
ArrowDownCircle,
ArrowForwardCircle,
ArrowRedoCircle,
ArrowRedo,
ArrowUndoCircle,
ArrowUndo,
ArrowUpCircle,
AtCircle,
Attach,
Backspace,
BagAdd,
BagCheck,
BagHandle,
BagRemove,
Bag,
Balloon,
Ban,
Bandage,
BarChart,
Barbell,
Barcode,
Baseball,
Basket,
Basketball,
BatteryCharging,
BatteryDead,
BatteryFull,
BatteryHalf,
Beaker,
Bed,
Beer,
Bicycle,
Binoculars,
Bluetooth,
Boat,
Body,
Bonfire,
Book,
Bookmark,
Bookmarks,
BowlingBall,
Briefcase,
Browsers,
Brush,
Bug,
Build,
Bulb,
Bus,
Business,
Cafe,
Calculator,
CalendarClear,
CalendarNumber,
Calendar,
Call,
CameraReverse,
Camera,
CarSport,
Car,
Card,
CaretBackcircle,
CaretBack,
CaretDowncircle,
CaretDown,
CaretForwardcircle,
CaretForward,
CaretUpcircle,
CaretUp,
Cart,
Cash,
Cellular,
ChatboxEllipses,
Chatbox,
ChatbubbleEllipses,
Chatbubble,
Chatbubbles,
Checkbox,
CheckmarkCircle,
CheckmarkBackCircle,
CheckmarkForwardCircle,
CheckmarkUpCircle,
CheckmarkDownCircle,
CheckmarkDoneCircle,
ChevronBackCircle,
ChevronDoneCircle,
ChevronDownCircle,
ChevronForwardCircle,
ChevronUpCircle,
Clipboard,
CloseCircle,
CloudCircle,
CloudDone,
CloudOffline,
CloudUpload,
Cloud,
CloudyNight,
Cloudy,
CodeSlash,
Code,
Cog,
ColorFill,
ColorFilter,
ColorPalette,
ColorWand,
Compass,
Construct,
Contact,
Contract,
Contrast,
Copy,
Create,
Crop,
Cube,
Cute,
Desktop,
Diamond,
Dice,
Disc,
DocumentAttach,
DocumentLock,
DocumentText,
Document,
Documents,
Download,
Duplicate,
Ear,
Earth,
Easel,
Egg,
Ellipse,
EllipsisHorizontalCircle,
EllipsisVerticalCircle,
Enter,
Exit,
Expand,
ExtensionPuzzle,
EyeOff,
Eye,
Eyedrop,
FastFood,
Female,
FileTrayFull,
FileTrayStacked,
FileTray,
Film,
FilterCircle,
FingerPrint,
Fish,
Fitness,
Flag,
Flame,
FlashOff,
Flash,
Flashlight,
Flask,
Flower,
FolderOpen,
Folder,
Football,
Footsteps,
Funnel,
GameController,
Gift,
GitBranch,
GitCommit,
GitCompare,
GitMerge,
GitNetwork,
GitPullRequest,
Glasses,
Globe,
Golf,
Grid,
Hammer,
HandLeft,
HandRight,
Happy,
HardwareChip,
Headset,
HeartCircle,
HeartDislikeCircle,
HeartDislike,
HeartHalf,
Heart,
HelpBouy,
HelpCircle,
Home,
Hourglass,
IceCream,
IdCard,
Image,
Images,
Infinite,
InformationCircle,
InvertMode,
Journal,
Key,
Keypad,
Language,
Laptop,
Layers,
Leaf,
Library,
Link,
ListCircle,
List,
Locate,
Location,
LockClosed,
LockOpen,
LogIn,
LogOut,
LogoAlipay,
LogoAmazon,
LogoAmplify,
LogoAndroid,
Magnet,
MailOpen,
MailUnread,
Mail,
MaleFemale,
Male,
Man,
Map,
Medal,
Medical,
Medkit,
Megaphone,
Menu,
MicCircle,
MicOffCircle,
MicOff,
Mic,
Moon,
Move,
MusicalNote,
MusicalNotes,
NavigateCircle,
Navigate,
Newspaper,
NotificationsCircle,
NotificationsOffCircle,
NotificationsOff,
Notifications,
Nuclear,
Nutrition,
Options,
PaperPlane,
PartlySunny,
PauseCircle,
Pause,
Paw,
Pencil,
PeopleCircle,
People,
PeopleAdd,
PersonCircle,
PersonRemove,
Person,
PhoneLandscape,
PhonePortrait,
PieChart,
Pin,
Pint,
Pizza,
Planet,
PlayBackCircle,
PlayBack,
PlayForwardCircle,
PlayForward,
PlaySkipBackCircle,
PlaySkipBack,
PlaySkipForwardCircle,
PlaySkipForward,
Play,
Podium,
Power,
Pricetag,
Pricetags,
Print,
Prism,
Pulse,
Push,
QrCode,
RadioButtonOff,
RadioButtonOn,
Radio,
Rainy,
Reader,
Receipt,
Recording,
RefreshCircle,
Refresh,
ReloadCircle,
Reload,
RemoveCircle,
Repeat,
Resize,
Restaurant,
Ribbon,
Rocket,
Rose,
Sad,
Save,
Scale,
ScanCircle,
Scan,
School,
SearchCircle,
Search,
Send,
Server,
Settings,
Shapes,
ShareSocial,
Share,
ShieldCheckmark,
ShieldHalf,
Shield,
Shirt,
Shuffle,
Skull,
Snow,
Sparkles,
Speedometer,
Square,
StarHalf,
Star,
StatsChart,
StopCircle,
Stop,
Stopwatch,
Storefront,
Subway,
Sunny,
SwapHorizontal,
SwapVertical,
SyncCircle,
Sync,
TabletLandscape,
TabletPortrait,
Telescope,
Tennisball,
Terminal,
Text,
Thermometer,
ThumbsDown,
ThumbsUp,
Thunderstorm,
Ticket,
Time,
Timer,
Today,
Toggle,
TrailSign,
Train,
Transgender,
TrashBin,
Trash,
TrendingDown,
TrendingUp,
Triangle,
Trophy,
Tv,
Umbrella,
Unlink,
VideocamOff,
Videocam,
VolumeHigh,
VolumeLow,
VolumeMedium,
VolumeMute,
VolumeOff,
Walk,
Wallet,
Warning,
Watch,
Water,
Wifi,
Wine,
Woman,
Undefined,
}
impl IconName {
pub fn to_string(&self) -> String {
match self {
IconName::Accessibility => "accessibility".to_string(),
IconName::AddCircle => "add-circle".to_string(),
IconName::Airplane => "airplane".to_string(),
IconName::Alarm => "alarm".to_string(),
IconName::Albums => "albums".to_string(),
IconName::AlertCircle => "alert-circle".to_string(),
IconName::AmericanFootball => "american-football".to_string(),
IconName::Analytics => "analytics".to_string(),
IconName::Aperture => "aperture".to_string(),
IconName::Apps => "apps".to_string(),
IconName::Archive => "archive".to_string(),
IconName::ArrowBackCircle => "arrow-back-circle".to_string(),
IconName::ArrowDownCircle => "arrow-down-circle".to_string(),
IconName::ArrowForwardCircle => "arrow-forward-circle".to_string(),
IconName::ArrowRedoCircle => "arrow-redo-circle".to_string(),
IconName::ArrowRedo => "arrow-redo".to_string(),
IconName::ArrowUndoCircle => "arrow-undo-circle".to_string(),
IconName::ArrowUndo => "arrow-undo".to_string(),
IconName::ArrowUpCircle => "arrow-up-circle".to_string(),
IconName::AtCircle => "at-circle".to_string(),
IconName::Attach => "attach".to_string(),
IconName::Backspace => "backspace".to_string(),
IconName::BagAdd => "bag-add".to_string(),
IconName::BagCheck => "bag-check".to_string(),
IconName::BagHandle => "bag-handle".to_string(),
IconName::BagRemove => "bag-remove".to_string(),
IconName::Bag => "bag".to_string(),
IconName::Balloon => "balloon".to_string(),
IconName::Ban => "ban".to_string(),
IconName::Bandage => "bandage".to_string(),
IconName::BarChart => "bar-chart".to_string(),
IconName::Barbell => "barbell".to_string(),
IconName::Barcode => "barcode".to_string(),
IconName::Baseball => "baseball".to_string(),
IconName::Basket => "basket".to_string(),
IconName::Basketball => "basketball".to_string(),
IconName::BatteryCharging => "battery-charging".to_string(),
IconName::BatteryDead => "battery-dead".to_string(),
IconName::BatteryFull => "battery-full".to_string(),
IconName::BatteryHalf => "battery-half".to_string(),
IconName::Beaker => "beaker".to_string(),
IconName::Bed => "bed".to_string(),
IconName::Beer => "beert".to_string(),
IconName::Bicycle => "bicycle".to_string(),
IconName::Binoculars => "binoculars".to_string(),
IconName::Bluetooth => "bluetooth".to_string(),
IconName::Boat => "boat".to_string(),
IconName::Body => "body".to_string(),
IconName::Bonfire => "bonfire".to_string(),
IconName::Book => "".to_string(),
IconName::Bookmark => "bookmark".to_string(),
IconName::Bookmarks => "bookmarks".to_string(),
IconName::BowlingBall => "bowling-ball".to_string(),
IconName::Briefcase => "briefcase".to_string(),
IconName::Browsers => "browsers".to_string(),
IconName::Brush => "brush".to_string(),
IconName::Bug => "bug".to_string(),
IconName::Build => "build".to_string(),
IconName::Bulb => "bulb".to_string(),
IconName::Bus => "bus".to_string(),
IconName::Business => "business".to_string(),
IconName::Cafe => "cafe".to_string(),
IconName::Calculator => "calculator".to_string(),
IconName::CalendarClear => "calendar-clear".to_string(),
IconName::CalendarNumber => "calendar-number".to_string(),
IconName::Calendar => "calendar".to_string(),
IconName::Call => "call".to_string(),
IconName::CameraReverse => "camera-reverse".to_string(),
IconName::Camera => "camera".to_string(),
IconName::CarSport => "car-sport".to_string(),
IconName::Car => "car".to_string(),
IconName::Card => "card".to_string(),
IconName::CaretBackcircle => "caret-backcircle".to_string(),
IconName::CaretBack => "caret-back".to_string(),
IconName::CaretDowncircle => "caret-down-circle".to_string(),
IconName::CaretDown => "caret-down".to_string(),
IconName::CaretForwardcircle => "caret-forward-circle".to_string(),
IconName::CaretForward => "caret-forward".to_string(),
IconName::CaretUpcircle => "caret-up-circle".to_string(),
IconName::CaretUp => "caret-up".to_string(),
IconName::Cart => "cart".to_string(),
IconName::Cash => "cash".to_string(),
IconName::Cellular => "cellular".to_string(),
IconName::ChatboxEllipses => "chatbox-ellipses".to_string(),
IconName::Chatbox => "chatbox".to_string(),
IconName::ChatbubbleEllipses => "chat".to_string(),
IconName::Chatbubble => "chatbubble".to_string(),
IconName::Chatbubbles => "chatbubbles".to_string(),
IconName::Checkbox => "checkbox".to_string(),
IconName::CheckmarkCircle => "checkmark-circle".to_string(),
IconName::CheckmarkBackCircle => "checkmark-back-circle".to_string(),
IconName::CheckmarkDoneCircle => "checkmark-done-circle".to_string(),
IconName::CheckmarkForwardCircle => "checkmark-forward-circle".to_string(),
IconName::CheckmarkDownCircle => "checkmark-down-circle".to_string(),
IconName::CheckmarkUpCircle => "checkmark-up-circle".to_string(),
IconName::ChevronDoneCircle => "chevron-done-circle".to_string(),
IconName::ChevronBackCircle => "chevron-back-circle".to_string(),
IconName::ChevronForwardCircle => "chevron-back-circle".to_string(),
IconName::ChevronDownCircle => "chevron-down-circle".to_string(),
IconName::ChevronUpCircle => "chevron-up-circle".to_string(),
IconName::Clipboard => "clipboard".to_string(),
IconName::CloseCircle => "close-circle".to_string(),
IconName::CloudCircle => "cloud-circle".to_string(),
IconName::CloudDone => "cloud-done".to_string(),
IconName::CloudOffline => "cloud-offline".to_string(),
IconName::CloudUpload => "cloud-upload".to_string(),
IconName::Cloud => "cloud".to_string(),
IconName::CloudyNight => "cloudy-night".to_string(),
IconName::Cloudy => "cloudy".to_string(),
IconName::CodeSlash => "code-slash".to_string(),
IconName::Code => "code".to_string(),
IconName::Cog => "cog".to_string(),
IconName::ColorFill => "color-fill".to_string(),
IconName::ColorFilter => "color-filter".to_string(),
IconName::ColorPalette => "color-palette".to_string(),
IconName::ColorWand => "color-wand".to_string(),
IconName::Compass => "compass".to_string(),
IconName::Construct => "construct".to_string(),
IconName::Contact => "contact".to_string(),
IconName::Contract => "contract".to_string(),
IconName::Contrast => "contrast".to_string(),
IconName::Copy => "copy".to_string(),
IconName::Create => "create".to_string(),
IconName::Crop => "crop".to_string(),
IconName::Cube => "cube".to_string(),
IconName::Cute => "cute".to_string(),
IconName::Desktop => "desktop".to_string(),
IconName::Diamond => "diamond".to_string(),
IconName::Dice => "dice".to_string(),
IconName::Disc => "disc".to_string(),
IconName::DocumentAttach => "document-attach".to_string(),
IconName::DocumentLock => "document-lock".to_string(),
IconName::DocumentText => "document-text".to_string(),
IconName::Document => "document".to_string(),
IconName::Documents => "documents".to_string(),
IconName::Download => "download".to_string(),
IconName::Duplicate => "duplicate".to_string(),
IconName::Ear => "ear".to_string(),
IconName::Earth => "earth".to_string(),
IconName::Easel => "easel".to_string(),
IconName::Egg => "egg".to_string(),
IconName::Ellipse => "ellipse".to_string(),
IconName::EllipsisHorizontalCircle => "ellipsis-horizontal-circle".to_string(),
IconName::EllipsisVerticalCircle => "ellipsis-vertical-circle".to_string(),
IconName::Enter => "enter".to_string(),
IconName::Exit => "exit".to_string(),
IconName::Expand => "expand".to_string(),
IconName::ExtensionPuzzle => "extension-puzzle".to_string(),
IconName::EyeOff => "eye-off".to_string(),
IconName::Eye => "eye".to_string(),
IconName::Eyedrop => "eyedrop".to_string(),
IconName::FastFood => "fast-food".to_string(),
IconName::Female => "female".to_string(),
IconName::FileTrayFull => "file-tray-full".to_string(),
IconName::FileTrayStacked => "file-tray-stacked".to_string(),
IconName::FileTray => "file-tray".to_string(),
IconName::Film => "film".to_string(),
IconName::FilterCircle => "filter-circle".to_string(),
IconName::FingerPrint => "finger-print".to_string(),
IconName::Fish => "fish".to_string(),
IconName::Fitness => "fitness".to_string(),
IconName::Flag => "flag".to_string(),
IconName::Flame => "flame".to_string(),
IconName::FlashOff => "flash-off".to_string(),
IconName::Flash => "flash".to_string(),
IconName::Flashlight => "flashlight".to_string(),
IconName::Flask => "flask".to_string(),
IconName::Flower => "flower".to_string(),
IconName::FolderOpen => "folder-open".to_string(),
IconName::Folder => "folder".to_string(),
IconName::Football => "football".to_string(),
IconName::Footsteps => "footsteps".to_string(),
IconName::Funnel => "funnel".to_string(),
IconName::GameController => "game-controller".to_string(),
IconName::Gift => "gift".to_string(),
IconName::GitBranch => "git-branch".to_string(),
IconName::GitCommit => "git-commit".to_string(),
IconName::GitCompare => "git-compare".to_string(),
IconName::GitMerge => "git-merge".to_string(),
IconName::GitNetwork => "git-network".to_string(),
IconName::GitPullRequest => "git-pull-request".to_string(),
IconName::Glasses => "glasses".to_string(),
IconName::Globe => "globe".to_string(),
IconName::Golf => "golf".to_string(),
IconName::Grid => "grid".to_string(),
IconName::Hammer => "hammer".to_string(),
IconName::HandLeft => "hand-left".to_string(),
IconName::HandRight => "hand-right".to_string(),
IconName::Happy => "happy".to_string(),
IconName::HardwareChip => "hardware-chip".to_string(),
IconName::Headset => "headset".to_string(),
IconName::HeartCircle => "heart-circle".to_string(),
IconName::HeartDislikeCircle => "heart-dislike-circle".to_string(),
IconName::HeartDislike => "heart-dislike".to_string(),
IconName::HeartHalf => "heart-half".to_string(),
IconName::Heart => "heart".to_string(),
IconName::HelpBouy => "help-buoy".to_string(),
IconName::HelpCircle => "help-circle".to_string(),
IconName::Home => "home".to_string(),
IconName::Hourglass => "hourglass".to_string(),
IconName::IceCream => "ice-cream".to_string(),
IconName::IdCard => "id-card".to_string(),
IconName::Image => "image".to_string(),
IconName::Images => "images".to_string(),
IconName::Infinite => "infinite".to_string(),
IconName::InformationCircle => "information-circle".to_string(),
IconName::InvertMode => "invert-mode".to_string(),
IconName::Journal => "journal".to_string(),
IconName::Key => "key".to_string(),
IconName::Keypad => "keypad".to_string(),
IconName::Language => "language".to_string(),
IconName::Laptop => "laptop".to_string(),
IconName::Layers => "layers".to_string(),
IconName::Leaf => "leaf".to_string(),
IconName::Library => "library".to_string(),
IconName::Link => "link".to_string(),
IconName::ListCircle => "list-circle".to_string(),
IconName::List => "list".to_string(),
IconName::Locate => "locate".to_string(),
IconName::Location => "location".to_string(),
IconName::LockClosed => "lock-closed".to_string(),
IconName::LockOpen => "lock-open".to_string(),
IconName::LogIn => "log-in".to_string(),
IconName::LogOut => "log-out".to_string(),
IconName::LogoAlipay => "logo-alipay".to_string(),
IconName::LogoAmazon => "logo-amazon".to_string(),
IconName::LogoAmplify => "logo-amplify".to_string(),
IconName::LogoAndroid => "logo-android".to_string(),
IconName::Magnet => "magnet".to_string(),
IconName::MailOpen => "mail-open".to_string(),
IconName::MailUnread => "mail-unread".to_string(),
IconName::Mail => "mail".to_string(),
IconName::MaleFemale => "male-female".to_string(),
IconName::Male => "male".to_string(),
IconName::Man => "man".to_string(),
IconName::Map => "map".to_string(),
IconName::Medal => "medal".to_string(),
IconName::Medical => "medical".to_string(),
IconName::Medkit => "medkit".to_string(),
IconName::Megaphone => "megaphone".to_string(),
IconName::Menu => "menu".to_string(),
IconName::MicCircle => "mic-circle".to_string(),
IconName::MicOffCircle => "mic-off-circle".to_string(),
IconName::MicOff => "mic-off".to_string(),
IconName::Mic => "mic".to_string(),
IconName::Moon => "moon".to_string(),
IconName::Move => "move".to_string(),
IconName::MusicalNote => "musical-note".to_string(),
IconName::MusicalNotes => "musical-notes".to_string(),
IconName::NavigateCircle => "navigate-circle".to_string(),
IconName::Navigate => "navigate".to_string(),
IconName::Newspaper => "newspaper".to_string(),
IconName::NotificationsCircle => "notifications-circle".to_string(),
IconName::NotificationsOffCircle => "notifications-off-circle".to_string(),
IconName::NotificationsOff => "notifications-off".to_string(),
IconName::Notifications => "notifications".to_string(),
IconName::Nuclear => "nuclear".to_string(),
IconName::Nutrition => "nutrition".to_string(),
IconName::Options => "options".to_string(),
IconName::PaperPlane => "paper-plane".to_string(),
IconName::PartlySunny => "partly-sunny".to_string(),
IconName::PauseCircle => "pause-circle".to_string(),
IconName::Pause => "pause".to_string(),
IconName::Paw => "paw".to_string(),
IconName::Pencil => "pencil".to_string(),
IconName::PeopleCircle => "people-circle".to_string(),
IconName::People => "people".to_string(),
IconName::PeopleAdd => "person-add".to_string(),
IconName::PersonCircle => "person-circle".to_string(),
IconName::PersonRemove => "person-remove".to_string(),
IconName::Person => "person".to_string(),
IconName::PhoneLandscape => "phone-landscape".to_string(),
IconName::PhonePortrait => "phone-portrait".to_string(),
IconName::PieChart => "pie-chart".to_string(),
IconName::Pin => "pin".to_string(),
IconName::Pint => "pint".to_string(),
IconName::Pizza => "pizza".to_string(),
IconName::Planet => "planet".to_string(),
IconName::PlayBackCircle => "play-back-circle".to_string(),
IconName::PlayBack => "play-back".to_string(),
IconName::PlayForwardCircle => "play-forward-circle".to_string(),
IconName::PlayForward => "play-forward".to_string(),
IconName::PlaySkipBackCircle => "play-skip-back-circle".to_string(),
IconName::PlaySkipBack => "play-skip-back".to_string(),
IconName::PlaySkipForwardCircle => "play-skip-forward-circle".to_string(),
IconName::PlaySkipForward => "play-skip-forward".to_string(),
IconName::Play => "play".to_string(),
IconName::Podium => "podium".to_string(),
IconName::Power => "power".to_string(),
IconName::Pricetag => "pricetag".to_string(),
IconName::Pricetags => "pricetags".to_string(),
IconName::Print => "print".to_string(),
IconName::Prism => "prism".to_string(),
IconName::Pulse => "pulse".to_string(),
IconName::Push => "push".to_string(),
IconName::QrCode => "qr-code".to_string(),
IconName::RadioButtonOff => "radio-button-off".to_string(),
IconName::RadioButtonOn => "radio-button-on".to_string(),
IconName::Radio => "radio".to_string(),
IconName::Rainy => "rainy".to_string(),
IconName::Reader => "reader".to_string(),
IconName::Receipt => "receipt".to_string(),
IconName::Recording => "recording".to_string(),
IconName::RefreshCircle => "refresh-circle".to_string(),
IconName::Refresh => "refresh".to_string(),
IconName::ReloadCircle => "reload-circle".to_string(),
IconName::Reload => "reload".to_string(),
IconName::RemoveCircle => "remove-circle".to_string(),
IconName::Repeat => "repeat".to_string(),
IconName::Resize => "resize".to_string(),
IconName::Restaurant => "restaurant".to_string(),
IconName::Ribbon => "ribbon".to_string(),
IconName::Rocket => "rocket".to_string(),
IconName::Rose => "rose".to_string(),
IconName::Sad => "sad".to_string(),
IconName::Save => "save".to_string(),
IconName::Scale => "scale".to_string(),
IconName::ScanCircle => "scan-circle".to_string(),
IconName::Scan => "scan".to_string(),
IconName::School => "school".to_string(),
IconName::SearchCircle => "search-circle".to_string(),
IconName::Search => "search".to_string(),
IconName::Send => "send".to_string(),
IconName::Server => "server".to_string(),
IconName::Settings => "settings".to_string(),
IconName::Shapes => "shapes".to_string(),
IconName::ShareSocial => "share-social".to_string(),
IconName::Share => "share".to_string(),
IconName::ShieldCheckmark => "shield-checkmark".to_string(),
IconName::ShieldHalf => "shield-half".to_string(),
IconName::Shield => "shield".to_string(),
IconName::Shirt => "shirt".to_string(),
IconName::Shuffle => "shuffle".to_string(),
IconName::Skull => "skull".to_string(),
IconName::Snow => "snow".to_string(),
IconName::Sparkles => "sparkles".to_string(),
IconName::Speedometer => "speedometer".to_string(),
IconName::Square => "square".to_string(),
IconName::StarHalf => "star-half".to_string(),
IconName::Star => "star".to_string(),
IconName::StatsChart => "stats-chart".to_string(),
IconName::StopCircle => "stop-circle".to_string(),
IconName::Stop => "stop".to_string(),
IconName::Stopwatch => "stopwatch".to_string(),
IconName::Storefront => "storefront".to_string(),
IconName::Subway => "subway".to_string(),
IconName::Sunny => "sunny".to_string(),
IconName::SwapHorizontal => "swap-horizontal".to_string(),
IconName::SwapVertical => "swap-vertical".to_string(),
IconName::SyncCircle => "sync-circle".to_string(),
IconName::Sync => "sync".to_string(),
IconName::TabletLandscape => "tablet-landscape".to_string(),
IconName::TabletPortrait => "tablet-portrait".to_string(),
IconName::Telescope => "telescope".to_string(),
IconName::Tennisball => "tennisball".to_string(),
IconName::Terminal => "terminal".to_string(),
IconName::Text => "text".to_string(),
IconName::Thermometer => "thermometer".to_string(),
IconName::ThumbsDown => "thumbs-down".to_string(),
IconName::ThumbsUp => "thumbs-up".to_string(),
IconName::Thunderstorm => "thunderstorm".to_string(),
IconName::Ticket => "ticket".to_string(),
IconName::Time => "time".to_string(),
IconName::Timer => "timer".to_string(),
IconName::Today => "today".to_string(),
IconName::Toggle => "toggle".to_string(),
IconName::TrailSign => "trail-sign".to_string(),
IconName::Train => "train".to_string(),
IconName::Transgender => "transgender".to_string(),
IconName::TrashBin => "trash-bin".to_string(),
IconName::Trash => "trash".to_string(),
IconName::TrendingDown => "trending-down".to_string(),
IconName::TrendingUp => "trending-up".to_string(),
IconName::Triangle => "triangle".to_string(),
IconName::Trophy => "trophy".to_string(),
IconName::Tv => "tv".to_string(),
IconName::Umbrella => "umbrella".to_string(),
IconName::Unlink => "unlink".to_string(),
IconName::VideocamOff => "videocam-off".to_string(),
IconName::Videocam => "videocam".to_string(),
IconName::VolumeHigh => "volume-high".to_string(),
IconName::VolumeLow => "volume-low".to_string(),
IconName::VolumeMedium => "volume-medium".to_string(),
IconName::VolumeMute => "volume-mute".to_string(),
IconName::VolumeOff => "volume-off".to_string(),
IconName::Walk => "walk".to_string(),
IconName::Wallet => "wallet".to_string(),
IconName::Warning => "warning".to_string(),
IconName::Watch => "watch".to_string(),
IconName::Water => "water".to_string(),
IconName::Wifi => "wifi".to_string(),
IconName::Wine => "wine".to_string(),
IconName::Woman => "woman".to_string(),
IconName::Undefined => "".to_string(),
}
}
pub fn from_str(name: &str) -> Self {
match name {
"accessibiliy" => IconName::Accessibility,
"add-circle" => IconName::AddCircle,
"airplane" => IconName::Airplane,
"alarm" => IconName::Alarm,
"albums" => IconName::Albums,
"alert-circle" => IconName::AlertCircle,
"american-football" => IconName::AmericanFootball,
"analytics" => IconName::Analytics,
"aperture" => IconName::Aperture,
"apps" => IconName::Apps,
"archive" => IconName::Archive,
"arrow-back-circle" => IconName::ArrowBackCircle,
"arrow-down-circle" => IconName::ArrowDownCircle,
"arrow-forward-circle" => IconName::ArrowForwardCircle,
"arrow-redo-circle" => IconName::ArrowRedoCircle,
"arrow-redo" => IconName::ArrowRedo,
"arrow-undo-circle" => IconName::ArrowUndoCircle,
"arrow-undo" => IconName::ArrowUndo,
"arrow-up-circle" => IconName::ArrowUpCircle,
"at-circle" => IconName::AtCircle,
"attach" => IconName::Attach,
"backspace" => IconName::Backspace,
"bag-add" => IconName::BagAdd,
"bag-check" => IconName::BagCheck,
"bag-handle" => IconName::BagHandle,
"bag-remove" => IconName::BagRemove,
"bag" => IconName::Bag,
"balloon" => IconName::Balloon,
"ban" => IconName::Ban,
"bandage" => IconName::Bandage,
"bar-chart" => IconName::BarChart,
"barbell" => IconName::Barbell,
"barcode" => IconName::Barcode,
"baseball" => IconName::Baseball,
"basket" => IconName::Basket,
"basketball" => IconName::Basketball,
"battery-charging" => IconName::BatteryCharging,
"battery-dead" => IconName::BatteryDead,
"battery-full" => IconName::BatteryFull,
"battery-half" => IconName::BatteryHalf,
"beaker" => IconName::Beaker,
"bed" => IconName::Bed,
"beer" => IconName::Beer,
"bicycle" => IconName::Bicycle,
"binoculars" => IconName::Binoculars,
"bluetooth" => IconName::Bluetooth,
"boat" => IconName::Boat,
"body" => IconName::Body,
"bonfire" => IconName::Bonfire,
"book" => IconName::Book,
"bookmark" => IconName::Bookmark,
"bookmarks" => IconName::Bookmarks,
"bowling-ball" => IconName::BowlingBall,
"briefcase" => IconName::Briefcase,
"browsers" => IconName::Browsers,
"brush" => IconName::Brush,
"bug" => IconName::Bug,
"build" => IconName::Build,
"bulb" => IconName::Bulb,
"bus" => IconName::Bus,
"business" => IconName::Business,
"cafe" => IconName::Cafe,
"calculator" => IconName::Calculator,
"calendar-clear" => IconName::CalendarClear,
"calendar-number" => IconName::CalendarNumber,
"calendar" => IconName::Calendar,
"call" => IconName::Call,
"camera-reverse" => IconName::CameraReverse,
"camera" => IconName::Camera,
"car-sport" => IconName::CarSport,
"car" => IconName::Car,
"card" => IconName::Card,
"caret-back-circle" => IconName::CaretBackcircle,
"caret-back" => IconName::CaretBack,
"caret-down-circle" => IconName::CaretDowncircle,
"caret-down" => IconName::CaretDown,
"caret-forward-circle" => IconName::CaretForwardcircle,
"caret-forward" => IconName::CaretForward,
"caret-up-circle" => IconName::CaretUpcircle,
"caret-up" => IconName::CaretUp,
"cart" => IconName::Cart,
"cash" => IconName::Cash,
"cellular" => IconName::Cellular,
"chatbox-ellipses" => IconName::ChatboxEllipses,
"chatbox" => IconName::Chatbox,
"chatbubble-ellipses" => IconName::ChatbubbleEllipses,
"chatbubble" => IconName::Chatbubble,
"chatbubbles" => IconName::Chatbubbles,
"checkbox" => IconName::Checkbox,
"checkmark-circle" => IconName::CheckmarkCircle,
"checkmark-done-circle" => IconName::CheckmarkDoneCircle,
"chevron-back-circle" => IconName::CheckmarkDoneCircle,
"chevron-down-circle" => IconName::CheckmarkDoneCircle,
"chevron-forward-circle" => IconName::CheckmarkDoneCircle,
"chevron-up-circle" => IconName::CheckmarkDoneCircle,
"clipboard" => IconName::Clipboard,
"close-circle" => IconName::CloseCircle,
"cloud-circle" => IconName::CloudCircle,
"cloud-done," => IconName::CloudDone,
"cloud-download" => IconName::Download,
"cloud-offline" => IconName::CloudOffline,
"cloud-upload" => IconName::CloudUpload,
"cloud" => IconName::Cloud,
"cloudy-night" => IconName::CloudyNight,
"cloudy" => IconName::Cloudy,
"code-slash" => IconName::CodeSlash,
"code" => IconName::Code,
"cog" => IconName::Cog,
"color-fill" => IconName::ColorFill,
"color-filter" => IconName::ColorFilter,
"color-palette" => IconName::ColorPalette,
"color-wand" => IconName::ColorWand,
"compass" => IconName::Compass,
"construct" => IconName::Construct,
"contact" => IconName::Contact,
"contract" => IconName::Contract,
"contrast" => IconName::Contrast,
"copy" => IconName::Copy,
"create" => IconName::Create,
"crop" => IconName::Crop,
"cube" => IconName::Cube,
"cut" => IconName::Cute,
"desktop" => IconName::Desktop,
"diamond" => IconName::Diamond,
"dice" => IconName::Dice,
"disc" => IconName::Disc,
"document-attach" => IconName::DocumentAttach,
"document-lock" => IconName::DocumentLock,
"document-text" => IconName::DocumentText,
"document" => IconName::Document,
"documents" => IconName::Documents,
"download" => IconName::Download,
"duplicate" => IconName::Duplicate,
"ear" => IconName::Ear,
"earth" => IconName::Earth,
"easel" => IconName::Easel,
"egg" => IconName::Egg,
"ellipse" => IconName::Ellipse,
"ellipsis-horizontal-circle" => IconName::EllipsisHorizontalCircle,
"ellipsis-vertical-circle" => IconName::EllipsisVerticalCircle,
"enter" => IconName::Enter,
"exit" => IconName::Exit,
"expand" => IconName::Expand,
"extension-puzzle" => IconName::ExtensionPuzzle,
"eye-off" => IconName::EyeOff,
"eye" => IconName::Eye,
"eyedrop" => IconName::Eyedrop,
"fast-food" => IconName::FastFood,
"female" => IconName::Female,
"file-tray-full" => IconName::FileTrayFull,
"file-tray-stacked" => IconName::FileTrayStacked,
"file-tray" => IconName::FileTray,
"film" => IconName::Film,
"filter-circle" => IconName::FilterCircle,
"finger-print" => IconName::FingerPrint,
"fish" => IconName::Fish,
"fitness" => IconName::Fitness,
"flag" => IconName::Flag,
"flame" => IconName::Flame,
"flash-off" => IconName::FlashOff,
"flash" => IconName::Flash,
"flashlight" => IconName::Flashlight,
"flask" => IconName::Flask,
"flower" => IconName::Flower,
"folder-open" => IconName::FolderOpen,
"folder" => IconName::Folder,
"football" => IconName::Football,
"footsteps" => IconName::Footsteps,
"funnel" => IconName::Funnel,
"game-controller" => IconName::GameController,
"gift" => IconName::Gift,
"git-branch" => IconName::GitBranch,
"git-commit" => IconName::GitCommit,
"git-compare" => IconName::GitCompare,
"git-merge" => IconName::GitMerge,
"git-network" => IconName::GitNetwork,
"git-pull-request" => IconName::GitPullRequest,
"glasses" => IconName::Glasses,
"globe" => IconName::Globe,
"golf" => IconName::Golf,
"grid" => IconName::Grid,
"hammer" => IconName::Hammer,
"hand-left" => IconName::HandLeft,
"hand-right" => IconName::HandRight,
"happy" => IconName::Happy,
"hardware-chip" => IconName::HardwareChip,
"headset" => IconName::Headset,
"heart-circle" => IconName::HeartCircle,
"heart-dislike-circle" => IconName::HeartDislikeCircle,
"heart-dislike" => IconName::HeartDislike,
"heart-half" => IconName::HeartHalf,
"heart" => IconName::Heart,
"help-buoy" => IconName::HelpBouy,
"help-circle" => IconName::HelpCircle,
"home" => IconName::Home,
"hourglass" => IconName::Hourglass,
"ice-cream" => IconName::IceCream,
"id-card" => IconName::IdCard,
"image" => IconName::Image,
"images" => IconName::Images,
"infinite" => IconName::Infinite,
"information-circle" => IconName::InformationCircle,
"invert-mode" => IconName::InvertMode,
"journal" => IconName::Journal,
"key" => IconName::Key,
"keypad" => IconName::Keypad,
"language" => IconName::Language,
"laptop" => IconName::Laptop,
"layers" => IconName::Layers,
"leaf" => IconName::Leaf,
"library" => IconName::Library,
"link" => IconName::Link,
"list-circle" => IconName::ListCircle,
"list" => IconName::List,
"locate" => IconName::Locate,
"location" => IconName::Location,
"lock-closed" => IconName::LockClosed,
"lock-open" => IconName::LockOpen,
"log-in" => IconName::LogIn,
"log-out" => IconName::LogOut,
"logo-alipay" => IconName::LogoAlipay,
"logo-amazon" => IconName::LogoAmazon,
"logo-amplify" => IconName::LogoAmplify,
"logo-android" => IconName::LogoAndroid,
"magnet" => IconName::Magnet,
"mail-open" => IconName::MailOpen,
"mail-unread" => IconName::MailUnread,
"mail" => IconName::Mail,
"male-female" => IconName::MaleFemale,
"male" => IconName::Male,
"man" => IconName::Man,
"map" => IconName::Map,
"medal" => IconName::Medal,
"medical" => IconName::Medical,
"medkit" => IconName::Medkit,
"megaphone" => IconName::Megaphone,
"menu" => IconName::Menu,
"mic-circle" => IconName::MicCircle,
"mic-off-circle" => IconName::MicOffCircle,
"mic-off" => IconName::MicOff,
"mic" => IconName::Mic,
"moon" => IconName::Moon,
"move" => IconName::Move,
"musical-note" => IconName::MusicalNote,
"musical-notes" => IconName::MusicalNotes,
"navigate-circle" => IconName::NavigateCircle,
"navigate" => IconName::Navigate,
"newspaper" => IconName::Newspaper,
"notifications-circle" => IconName::NotificationsCircle,
"notifications-off-circle" => IconName::NotificationsOffCircle,
"notifications-off" => IconName::NotificationsOff,
"notifications" => IconName::Notifications,
"nuclear" => IconName::Nuclear,
"nutrition" => IconName::Nutrition,
"options" => IconName::Options,
"paper-plane" => IconName::PaperPlane,
"partly-sunny" => IconName::PartlySunny,
"pause-circle" => IconName::PauseCircle,
"pause" => IconName::Pause,
"paw" => IconName::Paw,
"pencil" => IconName::Pencil,
"people-circle" => IconName::PeopleCircle,
"people" => IconName::People,
"people-add" => IconName::PeopleAdd,
"person-circle" => IconName::PersonCircle,
"person-remove" => IconName::PersonRemove,
"person" => IconName::Person,
"phone-landscape" => IconName::PhoneLandscape,
"phone-portrait" => IconName::PhonePortrait,
"pie-chart" => IconName::PieChart,
"pin" => IconName::Pin,
"pint" => IconName::Pint,
"pizza" => IconName::Pizza,
"planet" => IconName::Planet,
"play-back-circle" => IconName::PlayBackCircle,
"play-back" => IconName::PlayBack,
"play-forward-circle" => IconName::PlayForwardCircle,
"play-forward" => IconName::PlayForward,
"play-skip-back-circle" => IconName::PlaySkipBackCircle,
"play-skip-back" => IconName::PlaySkipBack,
"play-skip-forward-circle" => IconName::PlaySkipForwardCircle,
"play-skip-forward" => IconName::PlaySkipForward,
"play" => IconName::Play,
"podium" => IconName::Podium,
"power" => IconName::Power,
"pricetag" => IconName::Pricetag,
"pricetags" => IconName::Pricetags,
"print" => IconName::Print,
"prism" => IconName::Prism,
"pulse" => IconName::Pulse,
"qr-code" => IconName::QrCode,
"radio-button-off" => IconName::RadioButtonOff,
"radio-button-on" => IconName::RadioButtonOn,
"radio" => IconName::Radio,
"rainy" => IconName::Rainy,
"reader" => IconName::Reader,
"receipt" => IconName::Receipt,
"recording" => IconName::Recording,
"refresh-circle" => IconName::RefreshCircle,
"refresh" => IconName::Refresh,
"reload-circle" => IconName::ReloadCircle,
"reload" => IconName::Reload,
"remove-circle" => IconName::RemoveCircle,
"repeat" => IconName::Repeat,
"resize" => IconName::Resize,
"restaurant" => IconName::Restaurant,
"ribbon" => IconName::Ribbon,
"rocket" => IconName::Rocket,
"rose" => IconName::Rose,
"sad" => IconName::Sad,
"save" => IconName::Save,
"scale" => IconName::Scale,
"scan-circle" => IconName::ScanCircle,
"scan" => IconName::Scan,
"school" => IconName::School,
"search-circle" => IconName::SearchCircle,
"search" => IconName::Search,
"send" => IconName::Send,
"server" => IconName::Server,
"settings" => IconName::Settings,
"shapes" => IconName::Shapes,
"share-social" => IconName::ShareSocial,
"share" => IconName::Share,
"shield-checkmark" => IconName::ShieldCheckmark,
"shield-half" => IconName::ShieldHalf,
"shield" => IconName::Shield,
"shirt" => IconName::Shirt,
"shuffle" => IconName::Shuffle,
"skull" => IconName::Skull,
"snow" => IconName::Snow,
"sparkles" => IconName::Sparkles,
"speedometer" => IconName::Speedometer,
"square" => IconName::Square,
"star-half" => IconName::StarHalf,
"star" => IconName::Star,
"stats-chart" => IconName::StatsChart,
"stop-circle" => IconName::StopCircle,
"stop" => IconName::Stop,
"stopwatch" => IconName::Stopwatch,
"storefront" => IconName::Storefront,
"subway" => IconName::Subway,
"sunny" => IconName::Sunny,
"swap-horizontal" => IconName::SwapHorizontal,
"swap-vertical" => IconName::SwapVertical,
"sync-circle" => IconName::SyncCircle,
"sync" => IconName::Sync,
"tablet-landscape" => IconName::TabletLandscape,
"tablet-portrait" => IconName::TabletPortrait,
"telescope" => IconName::Telescope,
"tennisball" => IconName::Tennisball,
"terminal" => IconName::Terminal,
"text" => IconName::Text,
"thermometer" => IconName::Thermometer,
"thumbs-down" => IconName::ThumbsDown,
"thumbs-up" => IconName::ThumbsUp,
"thunderstorm" => IconName::Thunderstorm,
"ticket" => IconName::Ticket,
"time" => IconName::Time,
"timer" => IconName::Timer,
"today" => IconName::Today,
"toggle" => IconName::Toggle,
"trail-sign" => IconName::TrailSign,
"train" => IconName::Train,
"transgender" => IconName::Transgender,
"trash-bin" => IconName::TrashBin,
"trash" => IconName::Trash,
"trending-down" => IconName::TrendingDown,
"trending-up" => IconName::TrendingUp,
"triangle" => IconName::Triangle,
"trophy" => IconName::Trophy,
"tv" => IconName::Tv,
"umbrella" => IconName::Umbrella,
"unlink" => IconName::Unlink,
"videocam-off" => IconName::VideocamOff,
"videocam" => IconName::Videocam,
"volume-high" => IconName::VolumeHigh,
"volume-low" => IconName::VolumeLow,
"volume-medium" => IconName::VolumeMedium,
"volume-mute" => IconName::VolumeMute,
"volume-off" => IconName::VolumeOff,
"walk" => IconName::Walk,
"wallet" => IconName::Wallet,
"warning" => IconName::Warning,
"watch" => IconName::Watch,
"water" => IconName::Water,
"wifi" => IconName::Wifi,
"wine" => IconName::Wine,
"woman" => IconName::Woman,
_ => IconName::Undefined, }
}
}