mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-07 08:23:55 +00:00
1b55dbc170
* style: tweaks to studio override * style: improvements to 12 hour format
24 lines
541 B
TypeScript
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>
|
|
);
|
|
}
|