#![allow(unused_must_use)]

use iced::{
    Center, Element, Length, Task, font,
    widget::{column, row},
};
use iced_fonts::{OCTICONS_FONT_BYTES, octicons::*};

pub fn main() -> iced::Result {
    iced::application(App::new, App::update, App::view)
        .title("octicons")
        .run()
}

#[derive(Default)]
struct App {}

#[derive(Debug, Clone, Copy)]
enum Message {
    FontLoaded(Result<(), font::Error>),
}

impl App {
    fn new() -> (Self, Task<Message>) {
        (
            Self {},
            Task::batch(vec![
                font::load(OCTICONS_FONT_BYTES).map(Message::FontLoaded),
            ]),
        )
    }

    fn update(&mut self, message: Message) {
        match message {
            Message::FontLoaded(result) => {
                dbg!(result);
            }
        }
    }

    fn view(&self) -> Element<Message> {
        column![
            row![
                space(),
                heart(),
                zap(),
                light_bulb(),
                repo(),
                repo_forked(),
                repo_push(),
                repo_pull(),
                book(),
                accessibility(),
                git_pull_request(),
                mark_github(),
                download(),
                upload(),
                accessibility_inset(),
                alert_fill(),
                file_code(),
                apps(),
                file_media(),
                file_zip(),
                archive(),
                tag(),
                file_directory(),
                file_submodule(),
                person(),
                arrow_both(),
                git_commit(),
                git_branch(),
            ]
            .padding(12)
            .spacing(20)
            .width(Length::Fill)
            .align_y(Center),
            row![
                git_merge(),
                mirror(),
                issue_opened(),
                issue_reopened(),
                issue_closed(),
                star(),
                comment(),
                question(),
                alert(),
                search(),
                gear(),
                arrow_down_left(),
                tools(),
                sign_out(),
                rocket(),
                rss(),
                paste(),
                sign_in(),
                organization(),
                device_mobile(),
                unfold(),
                check(),
                mail(),
                read(),
                arrow_up(),
                arrow_right(),
                arrow_down(),
                arrow_left(),
            ]
            .padding(12)
            .spacing(20)
            .width(Length::Fill)
            .align_y(Center),
            row![
                pin(),
                gift(),
                graph(),
                triangle_left(),
                credit_card(),
                clock(),
                ruby(),
                broadcast(),
                key(),
                arrow_down_right(),
                repo_clone(),
                diff(),
                eye(),
                comment_discussion(),
                arrow_switch(),
                dot_fill(),
                square_fill(),
                device_camera(),
                device_camera_video(),
                pencil(),
                info(),
                triangle_right(),
                triangle_down(),
                link(),
                plus(),
                three_bars(),
                code(),
                location(),
            ]
            .padding(12)
            .spacing(20)
            .width(Length::Fill)
            .align_y(Center),
            row![
                list_unordered(),
                list_ordered(),
                quote(),
                versions(),
                calendar(),
                lock(),
                diff_added(),
                diff_removed(),
                diff_modified(),
                diff_renamed(),
                horizontal_rule(),
                arrow_up_left(),
                milestone(),
                checklist(),
                megaphone(),
                chevron_right(),
                bookmark(),
                sliders(),
                meter(),
                history(),
                link_external(),
                mute(),
                x(),
                circle_slash(),
                pulse(),
                sync(),
                telescope(),
                arrow_up_right(),
            ]
            .padding(12)
            .spacing(20)
            .width(Length::Fill)
            .align_y(Center),
            row![
                home(),
                stop(),
                bug(),
                logo_github(),
                file_binary(),
                database(),
                server(),
                diff_ignored(),
                ellipsis(),
                bell_fill(),
                hubot(),
                bell_slash(),
                blocked(),
                bookmark_fill(),
                chevron_up(),
                chevron_down(),
                chevron_left(),
                triangle_up(),
                git_compare(),
                logo_gist(),
                file_symlink_file(),
                file_symlink_directory(),
                squirrel(),
                globe(),
                unmute(),
                mention(),
                package(),
                browser(),
            ]
            .padding(12)
            .spacing(20)
            .width(Length::Fill)
            .align_y(Center),
            row![
                terminal(),
                markdown(),
                dash(),
                fold(),
                inbox(),
                trash(),
                paintbrush(),
                flame(),
                briefcase(),
                plug(),
                bookmark_slash_fill(),
                mortar_board(),
                law(),
                thumbsup(),
                thumbsdown(),
                desktop_download(),
                beaker(),
                bell(),
                cache(),
                shield(),
                bold(),
                check_circle(),
                italic(),
                tasklist(),
                verified(),
                smiley(),
                unverified(),
                check_circle_fill(),
            ]
            .padding(12)
            .spacing(20)
            .width(Length::Fill)
            .align_y(Center),
            row![
                file(),
                grabber(),
                checkbox(),
                reply(),
                device_desktop(),
                circle(),
                clock_fill(),
                cloud(),
                cloud_offline(),
                code_of_conduct(),
                code_review(),
                code_square(),
                codescan(),
                codescan_checkmark(),
                codespaces(),
                columns(),
                command_palette(),
                commit(),
                container(),
                copilot(),
                copilot_error(),
                copilot_warning(),
                copy(),
                cpu(),
                cross_reference(),
                dependabot(),
                diamond(),
                discussion_closed(),
            ]
            .padding(12)
            .spacing(20)
            .width(Length::Fill)
            .align_y(Center),
            row![
                discussion_duplicate(),
                discussion_outdated(),
                dot(),
                duplicate(),
                eye_closed(),
                feed_discussion(),
                feed_forked(),
                feed_heart(),
                feed_merged(),
                feed_person(),
                feed_repo(),
                feed_rocket(),
                feed_star(),
                feed_tag(),
                feed_trophy(),
                file_added(),
                file_badge(),
                file_diff(),
                file_directory_fill(),
                file_directory_open_fill(),
                file_moved(),
                file_removed(),
                filter(),
                fiscal_host(),
                fold_down(),
                fold_up(),
                git_merge_queue(),
                git_pull_request_closed(),
            ]
            .padding(12)
            .spacing(20)
            .width(Length::Fill)
            .align_y(Center),
            row![
                git_pull_request_draft(),
                goal(),
                hash(),
                heading(),
                heart_fill(),
                home_fill(),
                hourglass(),
                id_badge(),
                image(),
                infinity(),
                issue_draft(),
                issue_tracked_by(),
                issue_tracks(),
                iterations(),
                kebab_horizontal(),
                key_asterisk(),
                log(),
                moon(),
                move_to_bottom(),
                move_to_end(),
                move_to_start(),
                move_to_top(),
                multi_select(),
                no_entry(),
                north_star(),
                note(),
                number(),
                package_dependencies(),
            ]
            .padding(12)
            .spacing(20)
            .width(Length::Fill)
            .align_y(Center),
            row![
                package_dependents(),
                paper_airplane(),
                paperclip(),
                passkey_fill(),
                people(),
                person_add(),
                person_fill(),
                play(),
                plus_circle(),
                project(),
                project_roadmap(),
                project_symlink(),
                project_template(),
                rel_file_path(),
                repo_deleted(),
                repo_locked(),
                repo_template(),
                report(),
                rows(),
                screen_full(),
                screen_normal(),
                share(),
                share_android(),
                shield_check(),
                shield_lock(),
                shield_slash(),
                shield_x(),
                sidebar_collapse(),
            ]
            .padding(12)
            .spacing(20)
            .width(Length::Fill)
            .align_y(Center),
            row![
                sidebar_expand(),
                single_select(),
                skip(),
                skip_fill(),
                sort_asc(),
                sort_desc(),
                sparkle_fill(),
                sponsor_tiers(),
                square(),
                stack(),
                star_fill(),
                stopwatch(),
                strikethrough(),
                sun(),
                tab(),
                tab_external(),
                table(),
                telescope_fill(),
                trophy(),
                typography(),
                unlink(),
                unlock(),
                unread(),
                video(),
                webhook(),
                workflow(),
                x_circle(),
                x_circle_fill(),
            ]
            .padding(12)
            .spacing(20)
            .width(Length::Fill)
            .align_y(Center),
            row![zoom_in(), zoom_out(), bookmark_slash(),]
                .padding(12)
                .spacing(20)
                .width(Length::Fill)
                .align_y(Center),
        ]
        .into()
    }
}
