import Add from "@mui/icons-material/Add";
import SyncOutlined from "@mui/icons-material/SyncOutlined";
import { Button } from "@/shared/ui/Button.jsx";
import { PageHead } from "@/shared/ui/PageHead.jsx";

export function MenuToolbar({ abilities, onCreateMenu, onCreatePermission, onSyncPermissions }) {
  return (
    <PageHead title="菜单权限">
      {abilities.canSyncPermission ? (
        <Button onClick={onSyncPermissions}>
          <SyncOutlined fontSize="small" />
          同步权限
        </Button>
      ) : null}
      {abilities.canCreatePermission ? (
        <Button onClick={onCreatePermission}>
          <Add fontSize="small" />
          新增权限
        </Button>
      ) : null}
      {abilities.canCreateMenu ? (
        <Button variant="primary" onClick={onCreateMenu}>
          <Add fontSize="small" />
          新增菜单
        </Button>
      ) : null}
    </PageHead>
  );
}
