2022-06-12 19:08:26 +00:00
|
|
|
import React, { useState } from 'react';
|
|
|
|
import { ClipboardListIcon } from '@heroicons/react/outline';
|
|
|
|
import { Dialog } from '@/components/elements/dialog';
|
|
|
|
import { Button } from '@/components/elements/button/index';
|
|
|
|
|
|
|
|
export default ({ meta }: { meta: Record<string, unknown> }) => {
|
|
|
|
const [ open, setOpen ] = useState(false);
|
|
|
|
|
|
|
|
return (
|
2022-06-12 19:40:14 +00:00
|
|
|
<div className={'self-center md:px-4'}>
|
2022-06-12 19:08:26 +00:00
|
|
|
<Dialog
|
|
|
|
open={open}
|
|
|
|
onClose={() => setOpen(false)}
|
|
|
|
hideCloseIcon
|
|
|
|
title={'Metadata'}
|
|
|
|
>
|
2022-06-12 19:16:48 +00:00
|
|
|
<pre className={'bg-gray-900 rounded p-2 overflow-x-scroll font-mono text-sm leading-relaxed'}>
|
|
|
|
{JSON.stringify(meta, null, 2)}
|
|
|
|
</pre>
|
2022-06-12 19:08:26 +00:00
|
|
|
<Dialog.Buttons>
|
|
|
|
<Button.Text onClick={() => setOpen(false)}>Close</Button.Text>
|
|
|
|
</Dialog.Buttons>
|
|
|
|
</Dialog>
|
|
|
|
<button
|
2022-06-18 16:52:26 +00:00
|
|
|
aria-describedby={'View additional event metadata'}
|
2022-06-12 19:08:26 +00:00
|
|
|
className={'p-2 transition-colors duration-100 text-gray-400 group-hover:text-gray-300 group-hover:hover:text-gray-50'}
|
|
|
|
onClick={() => setOpen(true)}
|
|
|
|
>
|
|
|
|
<ClipboardListIcon className={'w-5 h-5'}/>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|