recipe_app/frontend/src/components/CookbookRecipeTile.tsx

25 lines
965 B
TypeScript
Raw Normal View History

import { type RecipeSmall } from "../types/Recipe"
import { Link } from 'react-router-dom';
import StarRating from '../components/StarRating.tsx'
2025-08-07 10:36:07 -07:00
import TimeDisplay from "../components/TimeDisplay.tsx"
2025-07-08 10:40:49 -07:00
function CookbookRecipeTile({ recipe }: { recipe: RecipeSmall }) {
2025-07-08 14:33:28 -07:00
2025-07-08 10:40:49 -07:00
return (
<div className="recipe-card m-2 bg-amber-200 p-4 rounded shadow">
2025-07-11 17:06:41 -07:00
<div className="flex justify-between items-center recipe-name">
<h3 className="font-bold text-xl"><Link to={`/recipe/${recipe.id}`} className="text-blue-500">{recipe.name}</Link></h3>
<div className="ar-button bg-amber-600 text-white py-0 px-2 rounded m-2">
{recipe.cuisine}
</div>
</div>
<div className="flex justify-between items-center">
2025-08-07 10:36:07 -07:00
<TimeDisplay minutes={recipe.prep_minutes + recipe.cook_minutes} />
<StarRating rating={recipe.stars} onRatingChange={() => { }} />
2025-07-08 10:40:49 -07:00
</div>
2025-07-08 14:33:28 -07:00
</div>
2025-07-08 10:40:49 -07:00
);
2025-07-11 17:06:41 -07:00
};
2025-07-08 10:40:49 -07:00
export default CookbookRecipeTile;