import {faHouse, 
        faBolt, 
        faCode,
        faCamera,
        faCar,
        faWrench,
        faGamepad,
        faQuestion} from "@fortawesome/free-solid-svg-icons";


export function getSubreactFromLocation(location) {
    const paths = location.pathname.split("/");
    return paths.length >= 1 ? paths[1] : "";
}

export function getInfoFromSubreact(subreact) {
    switch (subreact) {
        case "": return {icon: faHouse, name: "home"}
        case "t": return {icon: faBolt, name: "technology"}
        case "g": return {icon: faGamepad, name: "gaming"}
        case "k": return {icon: faCode, name: "programming"}
        case "p": return {icon: faCamera, name: "photography"}
        case "a": return {icon: faCar, name: "automobiles"}
        case "pr": return {icon: faWrench, name: "projects"}
        case "m": return {icon: faQuestion, name: "miscellaneous"}
        default: break;
    }
    return {};
}