-
{
- e.preventDefault()
-
- if (!c.folder && fileIsImage(c.name)) {
- setActiveImageIdx(imageIndexDict[c.id])
- setImageViewerVisibility(true)
- } else {
- router.push(`${path === '/' ? '' : path}/${encodeURIComponent(c.name)}`)
- }
- }}
- >
-
-
- {c.folder ? (
+ <>
+
+
+
Name
+
Last Modified
+
Size
+
Actions
+
- {
- clipboard.copy(`${getBaseUrl()}${path === '/' ? '' : path}/${encodeURIComponent(c.name)}`)
- toast('Copied folder permalink.', { icon: '👌' })
- }}
- >
-
-
- {folderGenerating[c.id] ? (
-
+
+ {totalGenerating ? (
+
) : (
- {
- const p = `${path === '/' ? '' : path}/${encodeURIComponent(c.name)}`
- handleFolderDownload(p, c.id, c.name)()
- }}
+
+
)}
- ) : (
-
-
{
- clipboard.copy(
- `${getBaseUrl()}/api?path=${path === '/' ? '' : path}/${encodeURIComponent(c.name)}&raw=true`
- )
- toast.success('Copied raw file permalink.')
- }}
- >
-
-
-
-
-
+
+
+
+
+
+ {imagesInFolder.length !== 0 && (
+
{
+ setImageViewerVisibility(false)
+ }}
+ customToolbar={toolbars => {
+ toolbars[0].render =
+ toolbars[1].render =
+ toolbars[2].render =
+ toolbars[3].render =
+ toolbars[4].render =
+ toolbars[9].render =
+ return toolbars.concat([
+ {
+ key: 'copy',
+ render: ,
+ onClick: i => {
+ clipboard.copy(i.alt ? `${getBaseUrl()}/api?path=${path + '/' + i.alt}&raw=true` : '')
+ toast('Copied image permanent link to clipboard.', { icon: '👌' })
+ },
+ },
+ ])
+ }}
+ />
+ )}
+
+ {children.map((c: any) => (
+
+
{
+ e.preventDefault()
+
+ if (!c.folder && fileIsImage(c.name)) {
+ setActiveImageIdx(imageIndexDict[c.id])
+ setImageViewerVisibility(true)
+ } else {
+ router.push(`${path === '/' ? '' : path}/${encodeURIComponent(c.name)}`)
+ }
+ }}
+ >
+
- )}
-
- {c.folder || c.name === '.password' ? (
- ''
- ) : (
- toggleItemSelected(c.id)}
- title="Select file"
- />
- )}
-
-
- ))}
-
- {!onlyOnePage && (
-
-
- - showing {size} page{size > 1 ? 's' : ''} of {isLoadingMore ? '...' : children.length} files -
-
-
) : (
- <>
- Load more
-
- >
+
+
{
+ clipboard.copy(
+ `${getBaseUrl()}/api?path=${path === '/' ? '' : path}/${encodeURIComponent(c.name)}&raw=true`
+ )
+ toast.success('Copied raw file permalink.')
+ }}
+ >
+
+
+
+
+
+
)}
-
-
- )}
+
+ {c.folder || c.name === '.password' ? (
+ ''
+ ) : (
+ toggleItemSelected(c.id)}
+ title="Select file"
+ />
+ )}
+
+
+ ))}
+ {!onlyOnePage && (
+
+
+ - showing {size} page{size > 1 ? 's' : ''} of {isLoadingMore ? '...' : children.length} files -
+
+
+
+ )}
+
{renderReadme && (
-
-
- {/* Using rehypeRaw to render HTML inside Markdown is potentially dangerous, use under safe environments. (#18) */}
-
- {data}
-
-
- {standalone && (
-
-
+
+
+ {/* Using rehypeRaw to render HTML inside Markdown is potentially dangerous, use under safe environments. (#18) */}
+
+ {content}
+
+
+ {standalone && (
+
+
+
)}
)
diff --git a/components/previews/OfficePreview.tsx b/components/previews/OfficePreview.tsx
index c049e80..3489076 100644
--- a/components/previews/OfficePreview.tsx
+++ b/components/previews/OfficePreview.tsx
@@ -2,6 +2,7 @@ import { FunctionComponent, useEffect, useRef, useState } from 'react'
import Preview from 'preview-office-docs'
import DownloadButtonGroup from '../DownloadBtnGtoup'
+import { DownloadBtnContainer } from './Containers'
const OfficePreview: FunctionComponent<{ file: any }> = ({ file }) => {
const docContainer = useRef
(null)
@@ -20,9 +21,9 @@ const OfficePreview: FunctionComponent<{ file: any }> = ({ file }) => {
height="600"
/>
-