Use ClipboardButton everywhere

This commit is contained in:
Girish Ramakrishnan
2025-10-07 13:57:16 +02:00
parent 677f11ba1a
commit 24fc480f7b
7 changed files with 15 additions and 49 deletions
@@ -5,8 +5,7 @@ const i18n = useI18n();
const t = i18n.t;
import { ref, useTemplateRef } from 'vue';
import { Dialog, TextInput, FormGroup, Button, InputGroup } from '@cloudron/pankow';
import { copyToClipboard } from '@cloudron/pankow/utils';
import { Dialog, TextInput, ClipboardButton, FormGroup, Button, InputGroup } from '@cloudron/pankow';
import UsersModel from '../models/UsersModel.js';
const usersModel = UsersModel.create();
@@ -34,11 +33,6 @@ async function onSend() {
dialog.value.close();
}
function onCopyLink() {
copyToClipboard(resetLink.value);
window.pankow.notify({ type: 'success', text: 'Copied to clipboard!' });
}
defineExpose({
async open(u) {
user.value = u;
@@ -64,7 +58,7 @@ defineExpose({
<label class="control-label">{{ $t('users.passwordResetDialog.descriptionLink') }}</label>
<InputGroup>
<TextInput id="passwordResetLinkInput" style="flex-grow: 1;" v-model="resetLink" readonly/>
<Button tool @click="onCopyLink()" icon="fa fa-clipboard" />
<ClipboardButton :value="resetLink" />
</InputGroup>
</FormGroup>