2025-07-24 12:11:32 -07:00
|
|
|
import { type RecipeSmall } from "../types/Recipe"
|
2025-07-29 09:34:33 -07:00
|
|
|
import { Link } from 'react-router-dom';
|
2025-08-06 16:18:06 -07:00
|
|
|
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
|
|
|
|
2025-08-06 16:18:06 -07:00
|
|
|
function CookbookRecipeTile({ recipe }: { recipe: RecipeSmall }) {
|
2025-07-08 14:33:28 -07:00
|
|
|
|
2025-07-08 10:40:49 -07:00
|
|
|
return (
|
2025-08-06 16:18:06 -07:00
|
|
|
<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">
|
2025-08-06 16:18:06 -07:00
|
|
|
<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} />
|
2025-08-06 16:18:06 -07:00
|
|
|
<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;
|