Create plant display fields on the backend
This commit is contained in:
parent
73e7fe88f8
commit
edd2054763
3 changed files with 41 additions and 16 deletions
|
@ -17,23 +17,14 @@ export default function ResultsStep(props) {
|
|||
|
||||
const getTableRows = () => {
|
||||
return props.plants.map((plant) => {
|
||||
|
||||
const name = `${plant.name}/${plant.commonname}/${plant.synonym}`;
|
||||
const growthForm = `${plant.growth_form}/${plant.maxheight}/${plant.spacing}`;
|
||||
const moisturePreferences = `${plant.soil_variants.map((variant) => variant.name).join(', ')}`;
|
||||
const plantTolerances = `${plant.water_tolerance.level}/${plant.drought_tolerance.level}/${plant.frost_tolerance.level}/${plant.salinity_tolerance.level}`;;
|
||||
const ecosystemServices = `${plant.purpose}`;
|
||||
const carbonSequestration = ``
|
||||
const plantingStage = `${plant.stage}`
|
||||
|
||||
return createData(
|
||||
name,
|
||||
growthForm,
|
||||
moisturePreferences,
|
||||
plantTolerances,
|
||||
ecosystemServices,
|
||||
carbonSequestration,
|
||||
plantingStage
|
||||
plant.display_name,
|
||||
plant.display_growth_form,
|
||||
plant.moisture_preferences,
|
||||
plant.plant_tolerances,
|
||||
plant.ecosystem_services,
|
||||
plant.carbon_sequestration,
|
||||
plant.stage
|
||||
);
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue