mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-28 14:04:43 -04:00
![renovate[bot]](/assets/img/avatar_default.png)
* Update dependency eslint-plugin-import to v2.25.2 Signed-off-by: Renovate Bot <bot@renovateapp.com> Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> * Make type imports more explicit Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> * Enforce use of type imports Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: Tilman Vatteroth <git@tilmanvatteroth.de>
30 lines
1,003 B
TypeScript
30 lines
1,003 B
TypeScript
/*
|
|
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
|
*
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
import React, { Fragment, useState } from 'react'
|
|
import { Trans, useTranslation } from 'react-i18next'
|
|
import { DocumentInfoModal } from '../document-bar/document-info/document-info-modal'
|
|
import { SidebarButton } from './sidebar-button'
|
|
import type { SpecificSidebarEntryProps } from './types'
|
|
|
|
export const DocumentInfoSidebarEntry: React.FC<SpecificSidebarEntryProps> = ({ className, hide }) => {
|
|
const [showModal, setShowModal] = useState(false)
|
|
useTranslation()
|
|
|
|
return (
|
|
<Fragment>
|
|
<SidebarButton
|
|
hide={hide}
|
|
className={className}
|
|
icon={'line-chart'}
|
|
onClick={() => setShowModal(true)}
|
|
data-cy={'sidebar-btn-document-info'}>
|
|
<Trans i18nKey={'editor.modal.documentInfo.title'} />
|
|
</SidebarButton>
|
|
<DocumentInfoModal show={showModal} onHide={() => setShowModal(false)} />
|
|
</Fragment>
|
|
)
|
|
}
|