import React from 'react'; import {isPlainClick} from '../events'; import ActionsMenu from './ActionsMenu'; import CropChip from './CropChip'; import PlantingRow from './PlantingRow'; // One garden: its name and actions menu (top right), a picture, then what is // planted, as perennials (just names) and annuals (each with its progress). // Matches gardens/_card. export default function GardenCard({garden, defaultIconUrl, onPlant, highlightedId, onPlantingUpdated, onEditPlanting}) { const {id, name, url, image_url: imageUrl, owner, actions, perennials, annuals} = garden; const empty = perennials.length === 0 && annuals.length === 0; return (

{name}

{owner &&
owner: {owner.login_name}
}
{name}
{empty ? (

Nothing planted here yet.

) : ( <>

Perennials

{perennials.length > 0 ? (
{perennials.map((planting) => ( ))}
) : (

None

)}

Annuals

{annuals.length > 0 ? (
{annuals.map((planting) => ( ))}
) : (

None

)}
)}
); }