31 lines
582 B
Plaintext
31 lines
582 B
Plaintext
function Item({ name, isPacked }) {
|
|
if (isPacked) {
|
|
return null;
|
|
}
|
|
return <li className="item">{name}</li>;
|
|
}
|
|
|
|
export default function PackingList() {
|
|
return (
|
|
<section>
|
|
<h1>Sally Ride's Packing List</h1>
|
|
<ul>
|
|
<Item
|
|
isPacked={true}
|
|
name="Space suit"
|
|
/>
|
|
<Item
|
|
isPacked={true}
|
|
name="Helmet with a golden leaf"
|
|
/>
|
|
<Item
|
|
isPacked={false}
|
|
name="Photo of Tam"
|
|
/>
|
|
</ul>
|
|
</section>
|
|
);
|
|
}
|
|
|
|
// From https://react.dev/learn/conditional-rendering
|