mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-09-29 22:34:33 +00:00
42 lines
933 B
TypeScript
42 lines
933 B
TypeScript
import * as Sentry from '@sentry/react';
|
|
|
|
import {openModal} from 'sentry/actionCreators/modal';
|
|
import {Button} from 'sentry/components/button';
|
|
import TextCopyInput from 'sentry/components/textCopyInput';
|
|
import {IconUpload} from 'sentry/icons';
|
|
import {t} from 'sentry/locale';
|
|
|
|
function ShareModal({Header, Body}) {
|
|
const url = new URL(window.location.href);
|
|
|
|
return (
|
|
<div>
|
|
<Header>
|
|
<h3>{t('Share View')}</h3>
|
|
</Header>
|
|
<Body>
|
|
<TextCopyInput aria-label={t('Link to current view')} size="sm">
|
|
{url.toString()}
|
|
</TextCopyInput>
|
|
</Body>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
function ShareButton() {
|
|
return (
|
|
<Button
|
|
size="sm"
|
|
icon={<IconUpload size="sm" />}
|
|
onClick={() => {
|
|
Sentry.metrics.increment('ddm.share');
|
|
openModal(deps => <ShareModal {...deps} />);
|
|
}}
|
|
>
|
|
{t('Share')}
|
|
</Button>
|
|
);
|
|
}
|
|
|
|
export default ShareButton;
|