Skip to content

Instantly share code, notes, and snippets.

@peaceintheheart
Last active December 17, 2020 20:49
Show Gist options
  • Save peaceintheheart/33fc4af4d40b6c0d2b3a101f65f7e8b2 to your computer and use it in GitHub Desktop.
Save peaceintheheart/33fc4af4d40b6c0d2b3a101f65f7e8b2 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={featureHash}
selectedOption={selectedOption}
feature={feature}
summary={summary}
/>
);
});
return (
<section>
<div>
{summary}
</div>
<Total
selected={props.selected}
USCurrencyFormat={props.USCurrencyFormat}
/>
</section>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment