package com.example.components;

import com.vaadin.flow.component.icon.FontIcon;

/**
 * Font Awesome Free icon references, mirroring the ergonomics of
 * {@code VaadinIcon.create()}. Backed by the {@code fa-*} CSS classes
 * shipped in the bundled {@code @fortawesome/fontawesome-free} package.
 *
 * <p>Font Awesome paints glyphs via {@code content: var(--fa)} on
 * {@code ::before}; the glyph-specific class (e.g. {@code fa-sun}) is what
 * defines that {@code --fa} custom property, so both the family class
 * ({@code fa-solid}) and the glyph class must be present.
 */
public enum Fa {

    MOON("fa-solid", "fa-moon"),
    SUN("fa-solid", "fa-sun"),
    DASHBOARD("fa-solid", "fa-gauge-high"),
    FORM("fa-solid", "fa-rectangle-list"),
    TABLE("fa-solid", "fa-table"),
    GLOBE("fa-solid", "fa-globe"),
    SEARCH("fa-solid", "fa-magnifying-glass"),
    GRID("fa-solid", "fa-table-cells-large"),
    ADD("fa-solid", "fa-plus"),
    REMOVE("fa-solid", "fa-trash"),
    RESET("fa-solid", "fa-arrow-rotate-left"),
    DRAG("fa-solid", "fa-grip-vertical"),
    CLOSE("fa-solid", "fa-xmark");

    private final String[] classes;

    Fa(String... classes) {
        this.classes = classes;
    }

    public FontIcon create() {
        return new FontIcon(classes);
    }
}
