Write a React component named FeedTheBunny
that receives an object of type Bunny
as param:
type Bunny = {
name: string;
foodNeededPerDay: number;
};
The component will render a progress bar with the name of the bunny as label and a button with the text Feed me
.
When clicking the button, we'll give 5 units of food to bunny.
The progress bar should reflect how much food he has, compared with the total amount he needs. If we reached the total amount needed by the bunny, the button will dissapear and the following text should appear:
{Name} is fully fed.