Better display of epochs

This commit is contained in:
Ayaz Hafiz 2023-07-31 18:05:32 -05:00
parent bea445bafa
commit e3129032e8
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
8 changed files with 216 additions and 70 deletions

View file

@ -0,0 +1,35 @@
import clsx from "clsx";
import { EventEpoch } from "../../engine/engine";
interface EpochCellProps {
noLeadingText?: boolean;
epoch: EventEpoch;
className?: string;
}
const EPOCH_STYLES_ARRAY = [
"text-slate-900",
"font-mono",
"bg-slate-200",
"p-1",
"py-0",
"rounded-sm",
"ring-1",
"ring-slate-500",
"text-sm",
];
export const EPOCH_STYLES = clsx(...EPOCH_STYLES_ARRAY);
export default function EpochCell({
epoch,
className,
noLeadingText,
}: EpochCellProps) {
return (
<div className={clsx(EPOCH_STYLES, className)}>
{noLeadingText ? "" : "Epoch "}
{epoch}
</div>
);
}