refactor, added slate, added editor, added book

This commit is contained in:
lnn0q 2025-05-28 23:25:46 +03:00
parent bc250e73bb
commit 029b7e9353
33 changed files with 714 additions and 496 deletions

View file

@ -1,9 +1,16 @@
import { WorkingProgressStatus } from '@generated/types';
import dayjs from 'dayjs';
export function assertUnreachable(value: never): never {
throw new Error(`Unhandled scenario: ${value}`);
}
export function toFormattedDate({ value }: { value: string }): string {
const date = new Date(value);
const day = dayjs(date).format('DD.MM.YYYY');
return day;
}
export function toBgColorByProgressStatus(value: WorkingProgressStatus): string {
if (value === WorkingProgressStatus.InProgress) return 'yellow.500';
if (value === WorkingProgressStatus.Frozen) return 'blue.500';