import {Grid} from "antd";
import {useDispatch} from "react-redux";
import {setSelectedUser} from "../../../Redux/Slices/usersSlice.js";

const { useBreakpoint } = Grid;

const useProfilePageUI = (userData) => {
    const dispatch = useDispatch();
    const screens = useBreakpoint();

    const containerStyle = { padding: screens.xs ? 16 : 24 };
    const cardStyle = { marginBottom: 24 };
    const buttonStyle = { width: screens.xs ? "100%" : "auto" };


    const handleEditUser = () => {
        dispatch(setSelectedUser(userData))
    };

    return {
        containerStyle,
        cardStyle,
        buttonStyle,
        isMobile: screens.xs,
        handleEditUser,
    };
};

export default useProfilePageUI;