mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-09 05:41:57 -04:00

These icon replace fork awesome. A linter informs the user about the deprecation. See https://github.com/hedgedoc/hedgedoc/issues/2929 Co-authored-by: Philip Molares <philip.molares@udo.edu> Co-authored-by: Tilman Vatteroth <git@tilmanvatteroth.de> Signed-off-by: Philip Molares <philip.molares@udo.edu> Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
31 lines
1.2 KiB
TypeScript
31 lines
1.2 KiB
TypeScript
/*
|
|
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
|
*
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
import { useApplicationState } from '../../../../hooks/common/use-application-state'
|
|
import { NoteInfoLine } from './note-info-line'
|
|
import type { NoteInfoTimeLineProps } from './note-info-time-line'
|
|
import { UnitalicBoldTimeFromNow } from './utils/unitalic-bold-time-from-now'
|
|
import { DateTime } from 'luxon'
|
|
import React, { useMemo } from 'react'
|
|
import { Plus as IconPlus } from 'react-bootstrap-icons'
|
|
import { Trans } from 'react-i18next'
|
|
|
|
/**
|
|
* Renders an info line about the creation of the current note.
|
|
*
|
|
* @param size The size in which the line should be displayed.
|
|
*/
|
|
export const NoteInfoLineCreated: React.FC<NoteInfoTimeLineProps> = ({ size }) => {
|
|
const noteCreateTime = useApplicationState((state) => state.noteDetails.createdAt)
|
|
const noteCreateDateTime = useMemo(() => DateTime.fromSeconds(noteCreateTime), [noteCreateTime])
|
|
|
|
return (
|
|
<NoteInfoLine icon={IconPlus} size={size}>
|
|
<Trans i18nKey={'editor.modal.documentInfo.created'}>
|
|
<UnitalicBoldTimeFromNow time={noteCreateDateTime} />
|
|
</Trans>
|
|
</NoteInfoLine>
|
|
)
|
|
}
|