enhancement(sidebar): move note info modal into sidebar

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
Erik Michelson 2023-04-16 22:21:29 +02:00 committed by Tilman Vatteroth
parent e3a9f70965
commit b454e3be03
23 changed files with 258 additions and 327 deletions

View file

@ -0,0 +1,24 @@
/*
* SPDX-FileCopyrightText: 2023 The HedgeDoc developers (see AUTHORS file)
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
import type { DateTime } from 'luxon'
import React from 'react'
export interface TimeFromNowProps {
time: DateTime
}
/**
* Renders a given time relative to the current time.
*
* @param time The time to be rendered.
*/
export const TimeFromNow: React.FC<TimeFromNowProps> = ({ time }) => {
return (
<time title={time.toFormat('DDDD T')} dateTime={time.toString()}>
{time.toRelative()}
</time>
)
}