2024-11-30 02:19:32 +01:00
|
|
|
<template>
|
|
|
|
|
<span :class="cn('text-primary group', $props.class)">
|
|
|
|
|
<span class="group-hover:hidden">
|
|
|
|
|
<slot />
|
|
|
|
|
</span>
|
|
|
|
|
<span class="hidden group-hover:inline">
|
2024-11-30 18:21:40 +01:00
|
|
|
<span @click="copyText"
|
2024-11-30 02:19:32 +01:00
|
|
|
class="select-none cursor-pointer space-x-1">
|
|
|
|
|
<Clipboard class="size-4 -translate-y-0.5 inline" />
|
2024-12-07 22:17:22 +01:00
|
|
|
{{ m.clean_yummy_owl_reside() }}
|
2024-11-30 02:19:32 +01:00
|
|
|
</span>
|
|
|
|
|
</span>
|
|
|
|
|
</span>
|
|
|
|
|
</template>
|
|
|
|
|
|
2024-11-30 18:21:40 +01:00
|
|
|
<script lang="tsx" setup>
|
2024-11-30 02:19:32 +01:00
|
|
|
import { Check, Clipboard } from "lucide-vue-next";
|
|
|
|
|
import type { HTMLAttributes } from "vue";
|
2024-11-30 18:21:40 +01:00
|
|
|
import { toast } from "vue-sonner";
|
2025-06-26 22:39:02 +02:00
|
|
|
import { cn } from "@/lib/utils";
|
2024-12-07 22:17:22 +01:00
|
|
|
import * as m from "~/paraglide/messages.js";
|
2024-11-30 02:19:32 +01:00
|
|
|
|
|
|
|
|
const { text } = defineProps<{
|
|
|
|
|
text: string;
|
|
|
|
|
class?: HTMLAttributes["class"];
|
|
|
|
|
}>();
|
|
|
|
|
|
|
|
|
|
const { copy } = useClipboard();
|
|
|
|
|
const copyText = () => {
|
|
|
|
|
copy(text);
|
2024-12-01 15:30:42 +01:00
|
|
|
toast.success("Copied to clipboard");
|
2024-11-30 02:19:32 +01:00
|
|
|
};
|
|
|
|
|
</script>
|