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

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

export const useStyles = ({
    radiuses,
    borders,
    spaces,
    colors
}: YearSelectorDynamicStyle) => {
    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,
            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;
