import { Dimensions } from "react-native";

function setScreenSize() {
    // const SCREEN_WIDTH = Dimensions.get("window").width || 767; // fallback to 767 for ssr
    // const IPAD_WIDTH = 768;
    // const IPAD_PRO_WIDTH = 1024;

    // if (SCREEN_WIDTH < IPAD_WIDTH) {
    //     return "small";
    // }
    // if (SCREEN_WIDTH >= IPAD_WIDTH && SCREEN_WIDTH < IPAD_PRO_WIDTH) {
    //     return "medium";
    // }
    // if (SCREEN_WIDTH >= IPAD_PRO_WIDTH) {
    //     return "large";
    // }

    const SCREEN_WIDTH = Dimensions.get("window").width || 639; // fallback to 639 for ssr
    const SC_SM_WIDTH = 640;
    const SC_LG_WIDTH = 1024;

    if (SCREEN_WIDTH < SC_SM_WIDTH) {
        return "small";
    }
    if (SCREEN_WIDTH >= SC_SM_WIDTH && SCREEN_WIDTH < SC_LG_WIDTH) {
        return "medium";
    }
    if (SCREEN_WIDTH >= SC_LG_WIDTH) {
        return "large";
    }
}

export const screenSize = setScreenSize();
