mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-16 02:05:04 +01:00
78338205a3
* checkpoint * fix pg schema * fix mysql schema * change property names
43 lines
1.3 KiB
JavaScript
43 lines
1.3 KiB
JavaScript
import React, { useRef } from 'react';
|
|
import { FormattedMessage } from 'react-intl';
|
|
import { useRouter } from 'next/router';
|
|
import Button from 'components/common/Button';
|
|
import FormLayout, { FormButtons, FormRow } from 'components/layout/FormLayout';
|
|
import CopyButton from 'components/common/CopyButton';
|
|
|
|
export default function TrackingCodeForm({ values, onClose }) {
|
|
const ref = useRef();
|
|
const { basePath } = useRouter();
|
|
const { name, shareId } = values;
|
|
|
|
return (
|
|
<FormLayout>
|
|
<p>
|
|
<FormattedMessage
|
|
id="message.share-url"
|
|
defaultMessage="This is the publicly shared URL for {target}."
|
|
values={{ target: <b>{values.name}</b> }}
|
|
/>
|
|
</p>
|
|
<FormRow>
|
|
<textarea
|
|
ref={ref}
|
|
rows={3}
|
|
cols={60}
|
|
spellCheck={false}
|
|
defaultValue={`${
|
|
document.location.origin
|
|
}${basePath}/share/${shareId}/${encodeURIComponent(name)}`}
|
|
readOnly
|
|
/>
|
|
</FormRow>
|
|
<FormButtons>
|
|
<CopyButton type="submit" variant="action" element={ref} />
|
|
<Button onClick={onClose}>
|
|
<FormattedMessage id="label.cancel" defaultMessage="Cancel" />
|
|
</Button>
|
|
</FormButtons>
|
|
</FormLayout>
|
|
);
|
|
}
|