interface IProps { text: string; date: string; } const InfoDateAllert = ({ text, date }: IProps) => { function formatDate(dateTimeString: string) { const [datePart] = dateTimeString.split(' '); const [year, month, day] = datePart.split('-'); return `${day}-${month}-${year}`; } const readyDate = formatDate(date); return (