Skip to content

Instantly share code, notes, and snippets.

@peaceintheheart
Created December 17, 2020 16:43
Show Gist options
  • Save peaceintheheart/f44dd68fed71d72f04d8236d2c0d8d09 to your computer and use it in GitHub Desktop.
Save peaceintheheart/f44dd68fed71d72f04d8236d2c0d8d09 to your computer and use it in GitHub Desktop.
import React from "react";
import Option from "../Option/Option";
import Total from "../Total/Total";
export default function MainSummary(props) {
const { USCurrencyFormat } = props;
const summary = Object.keys(props.selected).map((feature, idx) => {
const featureHash = feature + "-" + idx;
const selectedOption = props.selected[feature];
return (
<Option
featureHash={props.featureHash}
selectedOption={props.selectedOption}
feature={props.feature}
summary={summary}
/>
);
});
return (
<>
{summary}
<Total
selected={props.selected}
USCurrencyFormat={props.USCurrencyFormat}
/>
</>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment