UNPKG

bananas-commerce-admin

Version:

What's this, an admin for apes?

38 lines 1.64 kB
import React, { useMemo } from "react"; import { Card, Typography } from "@mui/material"; import CardContent from "@mui/material/CardContent"; import CardHeader from "@mui/material/CardHeader"; import { useTheme } from "@mui/material/styles"; export const WidgetCard = ({ title, children, gridColumn, gridRow, order: orderValue = "var(--i, 100)", sx, ...props }) => { const theme = useTheme(); const order = useMemo(() => { const defaultOrder = { xs: 100, md: 100, lg: 100, xl: 100 }; if (typeof orderValue === "object") { return { ...defaultOrder, ...orderValue }; } return { xs: orderValue, md: orderValue, lg: orderValue, xl: orderValue }; }, [orderValue]); return (React.createElement(Card, { sx: { boxShadow: 0, borderRadius: 3, borderWidth: "1px", borderStyle: "solid", borderColor: theme.palette.divider, bgcolor: theme.palette.background.paper, flexBasis: theme.breakpoints.values.sm, width: "100%", height: "100%", flexGrow: 1, display: "flex", flexDirection: "column", position: "relative", gridColumn, gridRow, order, ...sx, }, ...props }, React.createElement(CardHeader, { title: React.createElement(Typography, { sx: { fontWeight: 700 }, variant: "body1" }, title) }), React.createElement(CardContent, { sx: { p: 0, pb: "8px !important", flexGrow: 1 } }, children))); }; export default WidgetCard; //# sourceMappingURL=WidgetCard.js.map