import React, { useState, useEffect } from 'react';
import classNames from 'classnames';

type PizzaProps = {
    name: string;
    title: string;
    price: number;
    id: string;
    check: string;
    onClick: () => void;
  };

export const Ingredients: React.FC<PizzaProps> = ({
    name,
    title,
    price,
    id,
    check
    }) => {
    return(
        <li className='ingredients_box'>
            <div className={classNames('ingredients_text_box')}>
                <div className={classNames('ingredients_img ' + name)}> </div>
                <p className='ingredients_name'>{title}</p>
                <p className='ingredients_price'>{price} p</p>
                <button type="submit"
                    className={'ingredients_button'}
                    name={name}
                    id={id}
                    value={check}
                    onClick={(e) => onclick}>{check === 'none' ? '+' : '-'}</button>
            </div>
        </li>
    )
}

export default Ingredients;