import { $eventbus } from "@racletteCore/main"

const copyToClipboard = (name: string, value: string) => {
  navigator.clipboard.writeText(value)
  $eventbus.emit("ui/addToSnackbar", {
    i18n: "core.copiedToClipboard$name",
    content: { name },
    color: "info",
  })
}

export { copyToClipboard }
