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

const stylesheet = StyleSheet.create({
    toolsContainer: {
        justifyContent: "space-between",
        flexDirection: "row",
        alignItems: "center"
    },
    calendarChangerToolContainer: {
        alignSelf: "baseline",
        flexDirection: "row"
    },
    loadingContainer: {
        justifyContent: "center",
        alignItems: "center",
        flex: 1
    },
    moreLoadingContainer: {
        justifyContent: "center",
        alignItems: "center",
        width: "100%"
    },
    headerContainer: {
        flexDirection: "column",
        width: "100%"
    },
    calendarChangerToolButton: {
    },
    contentContainer: {
        flexDirection: "column"
    },
    bottomContainer: {
        flexDirection: "row",
        alignItems: "center"
    },
    itemContentContainer: {
        flex: 1
    }
});

export const useStyles = ({
    radiuses,
    borders,
    spaces,
    colors
}: DateTimeSheetDynamicStyleType) => {
    const styles = {
        calendarChangerToolContainer: {
            borderColor: colors.content.border.subtle,
            marginBottom: spaces.spacingSm,
            borderRadius: radiuses.actions,
            borderWidth: borders.line
        } as Mutable<ViewStyle>,
        calendarChangerToolButton: {
            paddingHorizontal: spaces.spacingSm,
            paddingVertical: spaces.spacingSm,
            borderRadius: radiuses.actions
        } as Mutable<ViewStyle>,
        contentContainer: {
            paddingVertical: spaces.spacingSm
        } as Mutable<ViewStyle>,
        headerContainer: {
            marginBottom: spaces.spacingSm
        } as Mutable<ViewStyle>,
        cancelButton: {
            marginRight: spaces.spacingSm
        } as Mutable<ViewStyle>,
        bottomContainer: {
            marginTop: spaces.spacingSm,
            padding: spaces.spacingSm
        } as Mutable<ViewStyle>,
        okButton: {
            marginLeft: spaces.spacingSm
        } as Mutable<ViewStyle>,
        toolsContainer: {
            marginTop: spaces.spacingSm
        } as Mutable<ViewStyle>,
        loadingContainer: {
            padding: spaces.spacingMd
        } as Mutable<ViewStyle>,
        moreLoadingContainer: {
            padding: spaces.spacingSm
        } as Mutable<ViewStyle>,
        headerTitle: {
        } as Mutable<ViewStyle>
    };

    return styles;
};
export default stylesheet;
