add OdFileObject typings
This commit is contained in:
parent
abb8ca4b7f
commit
fd95e03795
|
@ -1,4 +1,6 @@
|
||||||
|
import { OdFileObject } from '../../types'
|
||||||
import { FC, useState } from 'react'
|
import { FC, useState } from 'react'
|
||||||
|
|
||||||
import ReactPlayer from 'react-player'
|
import ReactPlayer from 'react-player'
|
||||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
||||||
|
|
||||||
|
@ -12,7 +14,7 @@ enum PlayerState {
|
||||||
Paused,
|
Paused,
|
||||||
}
|
}
|
||||||
|
|
||||||
const AudioPreview: FC<{ file: any }> = ({ file }) => {
|
const AudioPreview: FC<{ file: OdFileObject }> = ({ file }) => {
|
||||||
const [playerStatus, setPlayerStatus] = useState(PlayerState.Loading)
|
const [playerStatus, setPlayerStatus] = useState(PlayerState.Loading)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
|
import { OdFileObject } from '../../types'
|
||||||
import { FC, useEffect, useRef, useState } from 'react'
|
import { FC, useEffect, useRef, useState } from 'react'
|
||||||
|
|
||||||
import { ReactReader } from 'react-reader'
|
import { ReactReader } from 'react-reader'
|
||||||
import type { Rendition } from 'epubjs'
|
import type { Rendition } from 'epubjs'
|
||||||
|
|
||||||
|
@ -6,7 +8,7 @@ import Loading from '../Loading'
|
||||||
import DownloadButtonGroup from '../DownloadBtnGtoup'
|
import DownloadButtonGroup from '../DownloadBtnGtoup'
|
||||||
import { DownloadBtnContainer } from './Containers'
|
import { DownloadBtnContainer } from './Containers'
|
||||||
|
|
||||||
const EPUBPreview: FC<{ file: any }> = ({ file }) => {
|
const EPUBPreview: FC<{ file: OdFileObject}> = ({ file }) => {
|
||||||
const [epubContainerWidth, setEpubContainerWidth] = useState(400)
|
const [epubContainerWidth, setEpubContainerWidth] = useState(400)
|
||||||
const epubContainer = useRef<HTMLDivElement>(null)
|
const epubContainer = useRef<HTMLDivElement>(null)
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
|
import { OdFileObject } from '../../types'
|
||||||
import { FC, useEffect, useRef, useState } from 'react'
|
import { FC, useEffect, useRef, useState } from 'react'
|
||||||
|
|
||||||
import Preview from 'preview-office-docs'
|
import Preview from 'preview-office-docs'
|
||||||
|
|
||||||
import DownloadButtonGroup from '../DownloadBtnGtoup'
|
import DownloadButtonGroup from '../DownloadBtnGtoup'
|
||||||
import { DownloadBtnContainer } from './Containers'
|
import { DownloadBtnContainer } from './Containers'
|
||||||
|
|
||||||
const OfficePreview: FC<{ file: any }> = ({ file }) => {
|
const OfficePreview: FC<{ file: OdFileObject }> = ({ file }) => {
|
||||||
const docContainer = useRef<HTMLDivElement>(null)
|
const docContainer = useRef<HTMLDivElement>(null)
|
||||||
const [docContainerWidth, setDocContainerWidth] = useState(600)
|
const [docContainerWidth, setDocContainerWidth] = useState(600)
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { OdFileObject } from '../../types'
|
||||||
import ReactPlayer from 'react-player'
|
import ReactPlayer from 'react-player'
|
||||||
import { useRouter } from 'next/router'
|
import { useRouter } from 'next/router'
|
||||||
import { useClipboard } from 'use-clipboard-copy'
|
import { useClipboard } from 'use-clipboard-copy'
|
||||||
|
@ -7,7 +8,7 @@ import { getBaseUrl } from '../../utils/getBaseUrl'
|
||||||
import { DownloadButton } from '../DownloadBtnGtoup'
|
import { DownloadButton } from '../DownloadBtnGtoup'
|
||||||
import { DownloadBtnContainer, PreviewContainer } from './Containers'
|
import { DownloadBtnContainer, PreviewContainer } from './Containers'
|
||||||
|
|
||||||
const VideoPreview: React.FC<{ file: any }> = ({ file }) => {
|
const VideoPreview: React.FC<{ file: OdFileObject }> = ({ file }) => {
|
||||||
const { asPath } = useRouter()
|
const { asPath } = useRouter()
|
||||||
const clipboard = useClipboard()
|
const clipboard = useClipboard()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue