From 00f147a7a687d5772bcc538bc606cfff972178cd Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Thu, 12 Oct 2023 17:24:13 +0200 Subject: feat(components): add a Time component Instead of using helpers functions to format the date each time we need to use a time element, it makes more sense to create a new component dedicated to this task. --- src/components/atoms/layout/copyright.tsx | 39 +++++++++++++------------------ 1 file changed, 16 insertions(+), 23 deletions(-) (limited to 'src/components/atoms/layout/copyright.tsx') diff --git a/src/components/atoms/layout/copyright.tsx b/src/components/atoms/layout/copyright.tsx index c60ff8b..3d56059 100644 --- a/src/components/atoms/layout/copyright.tsx +++ b/src/components/atoms/layout/copyright.tsx @@ -1,5 +1,6 @@ import type { FC, ReactNode } from 'react'; import styles from './copyright.module.scss'; +import { Time } from './time'; export type CopyrightDates = { /** @@ -32,26 +33,18 @@ export type CopyrightProps = { * * Renders a copyright information (owner, dates, license icon). */ -export const Copyright: FC = ({ owner, dates, icon }) => { - const getFormattedDate = (date: string) => { - const datetime = new Date(date).toISOString(); - - return ; - }; - - return ( -
- {owner} - {icon} - {getFormattedDate(dates.start)} - {dates.end ? ( - <> - - - {getFormattedDate(dates.end)} - - ) : ( - '' - )} -
- ); -}; +export const Copyright: FC = ({ owner, dates, icon }) => ( +
+ {owner} + {icon} +
+); -- cgit v1.2.3