import React, { useContext } from 'react'; import styles from '../styles/styles.module.css'; import { productContext } from './ProductCard'; export interface Props { className?: string; title?: string style?: React.CSSProperties } export const ProductTitle = ({ title, className, style }: Props) => { const { product } = useContext(productContext); return ( {title ? title : product.title} ); }