Open this example in the interactive library
Live preview
Source code
// components/BakerPercentageList.tsx
export default function BakerPercentageList({
grams = [120, 80, 50],
}: { grams?: number[] } = {}) {
return (
<ol>
{grams.map((g, i) => (
<li key={i}>
{grams[0] ? ((g / grams[0]) * 100).toFixed(1) : 0}% of flour weight
</li>
))}
</ol>
);
}
