recipe author and stars and a bit of cleanup
This commit is contained in:
parent
c47dac9986
commit
6f43d17ddd
21 changed files with 361 additions and 207 deletions
|
@ -1,17 +1,17 @@
|
|||
import React, { useState } from 'react';
|
||||
import { type Recipe } from "../types/Recipe"
|
||||
import { type RecipeSmall } from "../types/Recipe"
|
||||
import Modal from '../components/Modal.tsx'
|
||||
|
||||
interface CookbookRecipeTileProps {
|
||||
recipe: Recipe;
|
||||
recipe: RecipeSmall;
|
||||
handleDelete: (id: number | undefined) => void;
|
||||
}
|
||||
|
||||
function CookbookRecipeTile({ recipe, handleDelete }: CookbookRecipeTileProps) {
|
||||
const [isModalOpen, setIsModalOpen] = useState(false);
|
||||
|
||||
const openModal = () => setIsModalOpen(true);
|
||||
const closeModal = () => setIsModalOpen(false);
|
||||
const openModal = () => { setIsModalOpen(true) };
|
||||
const closeModal = () => { setIsModalOpen(false) };
|
||||
const confirmDelete = () => {
|
||||
handleDelete(recipe.id);
|
||||
closeModal();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue