Write a component named SpendingInfo
that receives a list of purchases as a prop:
type Purchase = {
id: string;
day: string; // format: "YYYY-MM-DD"
amount: number; // in USD
};
The component should group purchases by day and display the total amount spent per day in a list. Example output:
2020-05-15: 1250 USD
2020-06-01: 500 USD
If there are no purchases, display the message: No purchases found.