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