import {
    type TextStyle,
    type ViewStyle,
    StyleSheet
} from "react-native";
import type {
    TimeSelectorDynamicStyle
} from "./type";
import type {
    Mutable
} from "../../types";

const stylesheet = StyleSheet.create({
    container: {
        width: "100%"
    },
    rangeContainer: {
        flexDirection: "column"
    },
    inputsContainer: {
        justifyContent: "flex-start",
        flexDirection: "row",
        alignItems: "center"
    },
    colonText: {
    },
    timeTitle: {
    }
});

export const useStyles = ({
    isTimeSelectWorksWithCenterWhenTimePicker,
    pickerType,
    spaces
}: TimeSelectorDynamicStyle) => {
    const styles = {
        container: {
            marginTop: spaces.spacingMd
        } as Mutable<ViewStyle>,
        rangeContainer: {
        } as Mutable<ViewStyle>,
        inputsContainer: {
            marginTop: spaces.spacingXs
        } as Mutable<ViewStyle>,
        colonText: {
            marginHorizontal: spaces.spacingXs
        } as Mutable<TextStyle>,
        timeTitle: {
        } as Mutable<TextStyle>
    };

    if(pickerType === "time" && isTimeSelectWorksWithCenterWhenTimePicker) {
        styles.inputsContainer.justifyContent = "center";
        styles.rangeContainer.justifyContent = "center";
    }

    return styles;
};
export default stylesheet;
