Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/FoxxMD/multi-scrobbler. Scrobble plays from multiple sources to multiple clients docs.multi-scrobbler.app
deezer docker jellyfin koito lastfm listenbrainz maloja mopidy mpris music music-assistant plex scrobble self-hosted spotify subsonic tautulli youtube-music
Something went wrong. Try again.
755 B · 21 lines
TSX
123456789101112131415161718192021import { Text } from "@chakra-ui/react"import type {Dayjs} from 'dayjs';import dayjs from 'dayjs';import { shortTodayAwareFormat } from "../../core/TimeUtils";import type {ComponentProps} from "react";
export type DateDisplayProps = { date?: string | Dayjs prefix?: string} & ComponentProps<typeof Text>export const ShortDateDisplay = (props: DateDisplayProps) => { const { date, prefix, ...rest } = props; if(date === undefined) { return <Text textStyle="xs" color="fg.muted" {...rest}>(No Date)</Text> } return <Text textStyle="xs" color="fg.muted" {...rest}>{`${prefix !== undefined ? `${prefix} ` : ''}${shortTodayAwareFormat(typeof date === 'string' ? dayjs(date) : date)}`}</Text>}