|
|
@@ -3,11 +3,12 @@ import { useTranslation } from 'react-i18next'
|
|
|
import OLButton from '@/shared/components/ol/ol-button'
|
|
|
import OLTooltip from '@/shared/components/ol/ol-tooltip'
|
|
|
import OLIconButton from '@/shared/components/ol/ol-icon-button'
|
|
|
+import MaterialIcon from '@/shared/components/material-icon'
|
|
|
|
|
|
export const CopyToClipboard = memo<{
|
|
|
content: string
|
|
|
tooltipId: string
|
|
|
- kind?: 'text' | 'icon'
|
|
|
+ kind?: 'text' | 'icon' | 'button'
|
|
|
unfilled?: boolean
|
|
|
onClick?: () => void
|
|
|
}>(({ content, tooltipId, kind = 'icon', unfilled = false, onClick }) => {
|
|
|
@@ -46,6 +47,20 @@ export const CopyToClipboard = memo<{
|
|
|
>
|
|
|
{t('copy')}
|
|
|
</OLButton>
|
|
|
+ ) : kind === 'button' ? (
|
|
|
+ <OLButton
|
|
|
+ onClick={handleClick}
|
|
|
+ size="sm"
|
|
|
+ variant="ghost"
|
|
|
+ className="copy-button copy-button-ghost"
|
|
|
+ >
|
|
|
+ {copied ? (
|
|
|
+ <MaterialIcon type="check" />
|
|
|
+ ) : (
|
|
|
+ <MaterialIcon type="content_copy" unfilled />
|
|
|
+ )}
|
|
|
+ {t('copy')}
|
|
|
+ </OLButton>
|
|
|
) : (
|
|
|
<OLIconButton
|
|
|
onClick={handleClick}
|