Files
react-test/docs/data/material/getting-started/templates/crud-dashboard/components/DashboardSidebarDividerItem.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

29 lines
780 B
JavaScript
Raw Normal View History

2025-12-12 14:26:25 +09:00
import * as React from 'react';
import Divider from '@mui/material/Divider';
import DashboardSidebarContext from '../context/DashboardSidebarContext';
import { getDrawerSxTransitionMixin } from '../mixins';
export default function DashboardSidebarDividerItem() {
const sidebarContext = React.useContext(DashboardSidebarContext);
if (!sidebarContext) {
throw new Error('Sidebar context was used without a provider.');
}
const { fullyExpanded = true, hasDrawerTransitions } = sidebarContext;
return (
<li>
<Divider
sx={{
borderBottomWidth: 1,
my: 1,
mx: -0.5,
...(hasDrawerTransitions
? getDrawerSxTransitionMixin(fullyExpanded, 'margin')
: {}),
}}
/>
</li>
);
}