feat(nuxt): nuxt3 -> nuxt4

This commit is contained in:
2026-02-21 16:22:51 +01:00
parent 6a74e8c6ea
commit c4c165edab
22 changed files with 6600 additions and 9049 deletions

View File

@@ -0,0 +1 @@
export const useBaseApiUrl = () => `${useRequestURL().origin}/api`;

View File

@@ -0,0 +1,29 @@
export const useCopyable = (
valueOrCallback:
| string
| Ref<string>
| (() => PromiseLike<string>)
| (() => PromiseLike<void>),
) => {
const icon = ref("i-heroicons-clipboard-document");
const label = ref("Copy");
const copy = async () => {
if (typeof valueOrCallback === "function") {
await valueOrCallback();
} else {
const value = unref(valueOrCallback);
await navigator.clipboard.writeText(value);
}
icon.value = "i-heroicons-clipboard-document-check";
label.value = "Copied!";
setTimeout(() => {
icon.value = "i-heroicons-clipboard-document";
label.value = "Copy";
}, 3000);
};
return { icon, copy, label };
};