import { sxx } from '@graphcommerce/next-ui' import type { SxProps, Theme } from '@mui/material' import { Box, Typography } from '@mui/material' import { productListPrice } from '../ProductListPrice' export type ProductListItemTitleAndPriceProps = { titleComponent?: React.ElementType title: React.ReactNode subTitle?: React.ReactNode children: React.ReactNode classes: { titleContainer: string; title: string; subtitle: string } sx?: SxProps } export function ProductListItemTitleAndPrice(props: ProductListItemTitleAndPriceProps) { const { titleComponent = 'h2', classes, children, subTitle, title, sx } = props return ( ({ display: 'grid', alignItems: 'baseline', marginTop: theme.spacings.xs, columnGap: 1, gridTemplateAreas: { xs: '"title title" "subtitle price"', md: '"title subtitle price"', }, gridTemplateColumns: { xs: 'unset', md: 'auto auto 1fr' }, justifyContent: 'space-between', }), sx, )} > {title} {subTitle && ( {subTitle} )} {children} ) }