mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-31 06:23:08 +02:00
Toast component and use for copy-as-curl
This commit is contained in:
13
src-web/hooks/useClipboardText.ts
Normal file
13
src-web/hooks/useClipboardText.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { readText } from '@tauri-apps/plugin-clipboard-manager';
|
||||
|
||||
export function useClipboardText() {
|
||||
return useQuery({
|
||||
queryKey: [],
|
||||
queryFn: async () => {
|
||||
const text = await readText();
|
||||
console.log('READ CLIPBOARD', text);
|
||||
return text;
|
||||
},
|
||||
}).data;
|
||||
}
|
||||
Reference in New Issue
Block a user