import { Theme, useTheme } from "@mui/material"; import React, { ComponentType, forwardRef } from "react"; type WithoutTheme

= Omit; function withTheme

(Component: ComponentType

) { return forwardRef(function ComponentWithTheme( props: WithoutTheme

, ref: any ) { const theme = useTheme(); const combinedProps = { ...props, theme } as P; return ; }); } export { withTheme };