import IconButton from "@mui/material/IconButton"; import ArrowRight from "../../ArrowRight/index.jsx"; import ArrowLeft from "../../ArrowLeft/index.jsx"; import { useTheme } from "@mui/material/styles"; import { useDispatch } from "react-redux"; import { toggleSidebar } from "../../../../Features/UI/uiSlice.js"; import PropTypes from "prop-types"; const CollapseButton = ({ collapsed }) => { const theme = useTheme(); const dispatch = useDispatch(); const arrowIcon = collapsed ? ( ) : ( ); return ( { dispatch(toggleSidebar()); }} > {arrowIcon} ); }; CollapseButton.propTypes = { collapsed: PropTypes.bool.isRequired, }; export default CollapseButton;