Files
ontime/apps/client/src/features/viewers/common/superscript-time/SuperscriptTime.tsx
T
Carlos Valente 1b55dbc170 style: clock period (#601)
* style: tweaks to studio override

* style: improvements to 12 hour format
2023-11-20 09:53:35 +01:00

24 lines
541 B
TypeScript

import { CSSProperties } from 'react';
import './SuperscriptTime.scss';
interface SuperscriptTimeProps {
time: string;
className?: string;
style?: CSSProperties;
}
export default function SuperscriptTime(props: SuperscriptTimeProps) {
const { time, className, style } = props;
// we assume anything after space is a period tag
const [timeString, period] = time.split(' ');
return (
<div className={className} style={style}>
{timeString}
{period && <sup className='period'>{period}</sup>}
</div>
);
}