import api from '@wakeapp/api';
export const copy = (something: string) => {
  const input = document.createElement('textarea');
  input.setAttribute('display', 'none');
  input.value = something;
  input.setAttribute('value', something);
  document.body.appendChild(input);
  input.select();
  if (document.execCommand('copy')) {
    document.execCommand('copy');
    api.showToast({ title: `复制成功 ${something}`, icon: 'none' });
  }
  document.body.removeChild(input);
};
