29 lines
673 B
TypeScript
29 lines
673 B
TypeScript
|
import React from "react";
|
||
|
import styles from "./EventSetting.module.css";
|
||
|
|
||
|
interface Props {
|
||
|
date: Date;
|
||
|
online: boolean;
|
||
|
location: string;
|
||
|
}
|
||
|
|
||
|
export function EventSetting(props: Props) {
|
||
|
const date = props.date.toLocaleDateString("en-US", {
|
||
|
day: "numeric",
|
||
|
month: "long",
|
||
|
year: "numeric",
|
||
|
});
|
||
|
const time = props.date.toLocaleTimeString("en-US", {
|
||
|
hour: "numeric",
|
||
|
minute: "numeric",
|
||
|
});
|
||
|
const location = props.online ? `Online - ${props.location}` : props.location;
|
||
|
|
||
|
return (
|
||
|
<div className={styles.setting}>
|
||
|
<time dateTime={props.date.toISOString()}>{`${date} | ${time}`}</time>
|
||
|
{` | ${location}`}
|
||
|
</div>
|
||
|
);
|
||
|
}
|