Files
contentstack-imagevault/rte/components/EmbedBtn.tsx
2024-03-26 13:03:24 +01:00

32 lines
616 B
TypeScript

import React, { PropsWithChildren } from "react"
import { Tooltip } from "@contentstack/venus-components"
type EmbedBtnProps = PropsWithChildren & {
content: string
onClick: (e: unknown) => void
title: string
}
export default function EmbedBtn({
content,
title,
onClick,
children,
}: EmbedBtnProps) {
return (
<Tooltip position="bottom" content={content}>
<button
id={title}
type="button"
onClick={(e) => {
e?.preventDefault()
e?.stopPropagation()
onClick(e)
}}
>
{children}
</button>
</Tooltip>
)
}