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

const stylesheet = StyleSheet.create({
    contentContainer: {
        justifyContent: "space-between",
        flexDirection: "column",
        alignItems: "center"
    },
    nextPrevToolContainer: {
        justifyContent: "space-between",
        flexDirection: "row",
        alignItems: "center",
        flex: 1
    },
    columnContainer: {
        justifyContent: "center",
        flexDirection: "column",
        alignItems: "center",
        flex: 1,
        flexShrink: 1
    },
    day: {
        justifyContent: "center",
        alignItems: "center",
        position: "relative",
        width: "100%",
        flex: 1,
        flexShrink: 1
    },
    todayIndicator: {
        position: "absolute",
        zIndex: 999
    },
    rowContainer: {
        flexDirection: "row"
    },
    container: {
        flex: 1
    }
});

export const useStyles = ({
    radiuses,
    borders,
    spaces,
    colors
}: MonthSelectorDynamicStyle) => {
    const styles = {
        todayIndicator: {
            borderColor: colors.content.border.default,
            borderBottomRightRadius: radiuses.full,
            borderBottomLeftRadius: radiuses.full,
            borderTopRightRadius: radiuses.full,
            borderTopLeftRadius: radiuses.full,
            borderWidth: borders.line,
            bottom: spaces.spacingXs,
            right: spaces.spacingXs,
            left: spaces.spacingXs,
            top: spaces.spacingXs
        } as Mutable<ViewStyle>,
        day: {
            borderBottomRightRadius: radiuses.full,
            borderBottomLeftRadius: radiuses.full,
            borderTopRightRadius: radiuses.full,
            borderTopLeftRadius: radiuses.full,
            borderColor: "transparent",
            borderWidth: borders.line,
            padding: spaces.spacingSm
        } as Mutable<ViewStyle>,
        nextPrevToolContainer: {
            marginBottom: spaces.spacingMd
        } as Mutable<ViewStyle>,
        nextPrevToolChevronButton: {
            padding: spaces.spacingSm
        } as Mutable<ViewStyle>
    };

    return styles;
};
export default stylesheet;
