use dartboard_picker_core::{sources, SectionSpec};
pub use dartboard_picker_core::{IconCatalogData, IconEntry};
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum IconPickerTab {
Emoji,
Unicode,
NerdFont,
}
impl IconPickerTab {
pub fn index(self) -> usize {
match self {
Self::Emoji => 0,
Self::Unicode => 1,
Self::NerdFont => 2,
}
}
}
const COMMON_EMOJI: &[&str] = &[
"๐",
"๐",
"๐",
"๐",
"๐",
"๐",
"๐",
"๐ซก",
"๐",
"๐",
"๐",
"๐ค",
"โค\u{fe0f}",
"โ
",
"๐ฅ",
"โก",
"๐",
"๐ค",
"๐ซ ",
"๐ฑ",
"๐ค",
"๐ง",
"๐",
"โญ",
"๐ฏ",
];
const COMMON_NERD_NAMES: &[&str] = &[
"cod hubot",
"md folder",
"md git",
"oct zap",
"md chart bar",
"cod credit card",
"md timer",
"md target",
"md rocket launch",
"seti code",
];
const COMMON_UNICODE: &[(&str, &str)] = &[
("โ", "Black Circle"),
("โ", "Black Diamond"),
("โ
", "Black Star"),
("โ", "Rightwards Arrow"),
("โ", "Box Drawings Light Vertical"),
("โ ", "Black Square"),
("โฒ", "Black Up-Pointing Triangle"),
("โ", "White Circle"),
("โฆ", "Black Four Pointed Star"),
("โฉ", "Mathematical Right Angle Bracket"),
("ยท", "Middle Dot"),
("ยป", "Right-Pointing Double Angle Quotation Mark"),
("โ", "Check Mark"),
("โ", "Ballot X"),
];
pub fn load_catalog() -> IconCatalogData {
let emoji_tab = vec![
SectionSpec::new("common emoji", sources::emoji_pick(COMMON_EMOJI)),
SectionSpec::new("all emoji", sources::emoji_all()),
];
let unicode_tab = vec![
SectionSpec::new("box drawing", sources::unicode_range(0x2500..=0x259F)),
SectionSpec::new("common", sources::unicode_pick(COMMON_UNICODE)),
SectionSpec::new("all unicode", sources::unicode_all()),
];
let nerd_tab = vec![
SectionSpec::new("common", sources::nerd_pick(COMMON_NERD_NAMES)),
SectionSpec::new("all nerd font", sources::nerd_all()),
];
IconCatalogData::new(vec![emoji_tab, unicode_tab, nerd_tab])
}