You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

18 lines
395 B

import React from "react";
const CurrentTime = ({ color, fontSize }) => {
const today = new Date(),
time =
today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
{
console.log(time);
}
return <p className={`${color} ${fontSize}`}>{time}</p>;
};
export default CurrentTime;
CurrentTime.defaultProps = {
color: "text-red-600",
fontSize: "text-lg",
};