diff --git a/web/src/components/core/copy/MqCopy.tsx b/web/src/components/core/copy/MqCopy.tsx new file mode 100644 index 0000000000..829aaaab14 --- /dev/null +++ b/web/src/components/core/copy/MqCopy.tsx @@ -0,0 +1,49 @@ +// Copyright 2018-2023 contributors to the Marquez project +// SPDX-License-Identifier: Apache-2.0 + +import { Snackbar, Tooltip } from '@mui/material' +import ContentCopyIcon from '@mui/icons-material/ContentCopy' +import IconButton from '@mui/material/IconButton' +import React from 'react' + +interface MqCopyProps { + string: string +} + +const MqEmpty: React.FC = ({ string }) => { + const [open, setOpen] = React.useState(false) + const handleClose = (event: React.SyntheticEvent | Event, reason?: string) => { + if (reason === 'clickaway') { + return + } + + setOpen(false) + } + return ( + <> + + { + event.stopPropagation() + navigator.clipboard.writeText(string) + setOpen(true) + }} + aria-label='copy' + size={'small'} + color={'primary'} + > + + + + + + ) +} + +export default MqEmpty diff --git a/web/src/routes/events/Events.tsx b/web/src/routes/events/Events.tsx index d360f8e7ab..78d3eff682 100644 --- a/web/src/routes/events/Events.tsx +++ b/web/src/routes/events/Events.tsx @@ -37,6 +37,7 @@ import MqStatus from '../../components/core/status/MqStatus' import MqText from '../../components/core/text/MqText' import React, { useEffect, useRef } from 'react' import moment from 'moment' +import MqCopy from '../../components/core/copy/MqCopy' interface StateProps { events: Event[] @@ -248,7 +249,10 @@ const Events: React.FC = ({ }} > - {event.run.runId} + + {event.run.runId} + +