mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-09 13:51:57 -04:00
enhancement(sidebar): move note info modal into sidebar
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
parent
e3a9f70965
commit
b454e3be03
23 changed files with 258 additions and 327 deletions
24
frontend/src/components/common/time-from-now.tsx
Normal file
24
frontend/src/components/common/time-from-now.tsx
Normal 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>
|
||||
)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue