mirror of
https://github.com/penxio/penx.git
synced 2026-04-19 03:03:06 -04:00
19 lines
507 B
TypeScript
19 lines
507 B
TypeScript
import { BACKGROUND_EVENTS } from '@/lib/constants'
|
|
import { AREAS_KEY } from '@/lib/helper'
|
|
import { useStorage } from '@plasmohq/storage/hook'
|
|
import { useQuery } from '@tanstack/react-query'
|
|
|
|
export function useLocalAreas() {
|
|
return useQuery({
|
|
queryKey: ['localAreas'],
|
|
queryFn: async () => {
|
|
const data = await chrome.runtime.sendMessage({
|
|
type: BACKGROUND_EVENTS.QUERY_AREAS,
|
|
})
|
|
console.log('========>>>data:', data)
|
|
|
|
return data?.areas as any[]
|
|
},
|
|
})
|
|
}
|