import { Clipboard } from "@capacitor/clipboard";

export function useClipboard() {
  function writeText(text: string): Promise<void> {
    return Clipboard.write({ string: text });
  }

  function readText() {
    return Clipboard.read().then(result => result);
  }

  return {
    writeText,
    readText,
  };
}
