feat(new tool): emoji picker (#551)

This commit is contained in:
Corentin THOMASSET authored and Corentin Thomasset committed 2023-08-08 22:25:59 +02:00
1 parent dfa1ba8554
commit 93f7cf0e98
11 files changed
+192 -6

No files matched your search

+4 -4
View File
@@ -1,14 +1,14 @@
import { type MaybeRef, get, useClipboard } from '@vueuse/core';
import { useMessage } from 'naive-ui';
export function useCopy({ source, text = 'Copied to the clipboard' }: { source: MaybeRef<unknown>; text?: string }) {
const { copy } = useClipboard({ source: computed(() => String(get(source))) });
export function useCopy({ source, text = 'Copied to the clipboard' }: { source?: MaybeRef<unknown>; text?: string } = {}) {
const { copy } = useClipboard(source ? { source: computed(() => String(get(source))) } : {});
const message = useMessage();
return {
async copy() {
async copy(content?: string, { notificationMessage }: { notificationMessage?: string } = {}) {
await copy();
message.success(text);
message.success(notificationMessage ?? text);
},
};
}