mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 13:13:45 +01:00
58 lines
1.7 KiB
TypeScript
58 lines
1.7 KiB
TypeScript
import { useTranslation, Trans } from 'react-i18next'
|
|
import Notification from '@/shared/components/notification'
|
|
import {
|
|
OLModalBody,
|
|
OLModalFooter,
|
|
} from '@/shared/components/ol/ol-modal'
|
|
import OLButton from '@/shared/components/ol/ol-button'
|
|
import { ProjectSyncState } from '../../types/git-sync-types'
|
|
|
|
type GitSyncNeedPermissionModalProps = {
|
|
projectSyncState: ProjectSyncState
|
|
handleHide: () => void
|
|
}
|
|
|
|
const GitSyncNeedPermissionModal = ({ projectSyncState, handleHide }: GitSyncConflictModalProps) => {
|
|
const { t } = useTranslation()
|
|
return (
|
|
<>
|
|
<OLModalBody>
|
|
<Notification
|
|
type="warning"
|
|
content={(
|
|
<Trans
|
|
i18nKey="ask_proj_owner_to_add_you_as_github_collaborator"
|
|
values={{
|
|
repoFullName: projectSyncState.repoFullName ?? '?',
|
|
projectOwnerEmail: projectSyncState.ownerEmail ?? '?',
|
|
}}
|
|
components={[
|
|
projectSyncState.repoFullName ? (
|
|
<a
|
|
href={`https://github.com/${projectSyncState.repoFullName}`}
|
|
target="_blank"
|
|
rel="noreferrer noopener"
|
|
/>
|
|
) : (
|
|
<></>
|
|
),
|
|
projectSyncState.ownerEmail ? <a href={`mailto:${projectSyncState.ownerEmail}`} /> : <></>
|
|
]}
|
|
/>
|
|
)}
|
|
/>
|
|
</OLModalBody>
|
|
<OLModalFooter>
|
|
<OLButton
|
|
variant="secondary"
|
|
onClick={handleHide}
|
|
>
|
|
{t('close')}
|
|
</OLButton>
|
|
</OLModalFooter>
|
|
</>
|
|
)
|
|
}
|
|
|
|
export default GitSyncNeedPermissionModal
|