A simple Button in NextJS in Typescript

Job ID: 33476915

Budget: $10 – $30 CAD

I need a button that changes color, So the button starts as red, onCLick it should change to green, but there should a an interval set that reverts the button back to red based on a choosen interval of 1min or 1day or and so on use these intervals:
const intervals = [
{ label: "year", seconds: 31536000 },
{ label: "month", seconds: 2592000 },
{ label: "day", seconds: 86400 },
{ label: "hour", seconds: 3600 },
{ label: "minute", seconds: 60 },
{ label: "second", seconds: 1 },
];
Related categories: React.js Typescript Next.js