const std = @import("std");

const api = @import("../../../../api/root.zig");
const embed = @import("../../../../embed.zig");

pub const data = embed.embedBase64Files(
    (struct {
        fn inner(comptime path: []const u8) []const u8 {
            return @embedFile(path);
        }
    }).inner,
    "image/svg+xml",
    "svg",
    "svg",
    &.{
        "train",
        "subway",
        "tram",
        "bus",
        "shuttle",
        "gondola",
        "flight",
        "boat",
        "no_transfer",
    },
){};

pub fn iconFromTransportationProductClass(class: api.efa.models.TransportationProductClass) ?embed.EncodedFile {
    return switch (class) {
        .zug,
        .s_bahn,
        .zug_nv,
        .zug_fv,
        .zug_fv_m_zuschlag,
        .zug_fv_m_spez_fpr,
        .zug_shuttle,
        => data.train,

        .u_bahn => data.subway,

        .stadtbahn, .strassen_trambahn => data.tram,

        .stadtbus,
        .regionalbus,
        .schnellbus,
        .buergerbus,
        .rufbus_liniengebunden,
        .rufbus,
        .anruf_sammel_taxi,
        => data.bus,

        .seil_zahnradbahn => data.gondola,

        .schiff => data.boat,

        .sonstige => null,

        .flugzeug => data.flight,

        .sev => data.no_transfer,

        _ => null,
    };
}
