How can I write this block of code more efficiently. To avoid repetition on the media query section?
const checkMediaStyles = () => ({
divBGDisplay: {
backgroundColor: {
xs: "red",
sm: "blue",
md: "yellow",
lg: "red",
xl: "purple",
},
marginLeft: (theme: { spacing: (arg0: number) => any }) => theme.spacing(2),
},
});
export default checkMediaStyles;
Code Sandbox