refactor: remove electron-related code
This commit is contained in:
parent
bed8df06e8
commit
2b1e6fe8f5
200 changed files with 2771 additions and 8432 deletions
13
src/hooks/useFetchWebMetadata.tsx
Normal file
13
src/hooks/useFetchWebMetadata.tsx
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import { TWebMetadata } from '@/types'
|
||||
import { useEffect, useState } from 'react'
|
||||
import webService from '@/services/web.service'
|
||||
|
||||
export function useFetchWebMetadata(url: string) {
|
||||
const [metadata, setMetadata] = useState<TWebMetadata>({})
|
||||
|
||||
useEffect(() => {
|
||||
webService.fetchWebMetadata(url).then((metadata) => setMetadata(metadata))
|
||||
}, [url])
|
||||
|
||||
return metadata
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue