initial commit
This commit is contained in:
commit
cd234531b9
37 changed files with 5529 additions and 0 deletions
25
frontend/src/components/CookbookRecipeTile.tsx
Normal file
25
frontend/src/components/CookbookRecipeTile.tsx
Normal file
|
@ -0,0 +1,25 @@
|
|||
import { type Recipe } from "../types/Recipe"
|
||||
|
||||
interface CookbookRecipeTileProps {
|
||||
recipe: Recipe;
|
||||
handleDelete: (id: number | undefined) => void;
|
||||
}
|
||||
|
||||
function CookbookRecipeTile({ recipe, handleDelete }: CookbookRecipeTileProps) {
|
||||
const deleteHandler = () => {
|
||||
if (handleDelete) {
|
||||
handleDelete(recipe.id);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="recipe-card">
|
||||
<div className="recipe-info">
|
||||
<h3><a href={`/recipe/${recipe.id}`}>{recipe.name}</a></h3>
|
||||
<button onClick={deleteHandler}>Delete Recipe</button>
|
||||
</div>
|
||||
</div >
|
||||
);
|
||||
}
|
||||
|
||||
export default CookbookRecipeTile;
|
Loading…
Add table
Add a link
Reference in a new issue