mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-15 09:45:04 +01:00
e1f99a7d01
* Rewrite admin. * Clean up password forms. * Fix naming issues. * CSS Naming.
24 lines
710 B
JavaScript
24 lines
710 B
JavaScript
import useConfig from 'hooks/useConfig';
|
|
import { useRef } from 'react';
|
|
import { Form, FormRow, TextArea } from 'react-basics';
|
|
|
|
export default function TrackingCodeForm({ websiteId }) {
|
|
const ref = useRef(null);
|
|
const { trackerScriptName } = useConfig();
|
|
const code = `<script async defer src="${trackerScriptName}" data-website-id="${websiteId}"></script>`;
|
|
|
|
return (
|
|
<>
|
|
<Form ref={ref}>
|
|
<FormRow>
|
|
<p>
|
|
To track stats for this website, place the following code in the{' '}
|
|
<code><head></code> section of your HTML.
|
|
</p>
|
|
<TextArea rows={4} value={code} readOnly allowCopy />
|
|
</FormRow>
|
|
</Form>
|
|
</>
|
|
);
|
|
}
|