return ( <div> <BillInputbill={bill}setBill={setBill} /> <SelectPercentagepercentage={percentage1}setPercentage={setPercentage1}> How did you like the service? </SelectPercentage> <SelectPercentagepercentage={percentage2}setPercentage={setPercentage2}> How did your friend like the service? </SelectPercentage> {bill > 0 && ( <> <Outputbill={bill}tip={tip} /> <Resetonreset={handleReset} /> </> )} </div> ); }
functionBillInput({ bill, setBill }) { return ( <div> <lable>How much was the bill?</lable> <input type="text" placeholder="Bill value" value={bill} onChange={(e) => setBill(Number(e.target.value))} /> </div> ); }