mirror of
https://github.com/bewcloud/bewcloud.git
synced 2026-03-11 08:54:49 +00:00
Implements the ability for users to download directories as zip files if enabled in config. Adds a new API route for directory zipping, updates UI components to show a download button for directories, and introduces related config and type changes. Also includes a new download icon.
37 lines
1.1 KiB
TypeScript
37 lines
1.1 KiB
TypeScript
import { Directory, DirectoryFile } from '/lib/types.ts';
|
|
import MainFiles from '/components/files/MainFiles.tsx';
|
|
|
|
interface FilesWrapperProps {
|
|
initialDirectories: Directory[];
|
|
initialFiles: DirectoryFile[];
|
|
initialPath: string;
|
|
baseUrl: string;
|
|
isFileSharingAllowed: boolean;
|
|
isDirectoryDownloadsAllowed: boolean;
|
|
fileShareId?: string;
|
|
}
|
|
|
|
// This wrapper is necessary because islands need to be the first frontend component, but they don't support functions as props, so the more complex logic needs to live in the component itself
|
|
export default function FilesWrapper(
|
|
{
|
|
initialDirectories,
|
|
initialFiles,
|
|
initialPath,
|
|
baseUrl,
|
|
isFileSharingAllowed,
|
|
isDirectoryDownloadsAllowed,
|
|
fileShareId,
|
|
}: FilesWrapperProps,
|
|
) {
|
|
return (
|
|
<MainFiles
|
|
initialDirectories={initialDirectories}
|
|
initialFiles={initialFiles}
|
|
initialPath={initialPath}
|
|
baseUrl={baseUrl}
|
|
isFileSharingAllowed={isFileSharingAllowed}
|
|
isDirectoryDownloadsAllowed={isDirectoryDownloadsAllowed}
|
|
fileShareId={fileShareId}
|
|
/>
|
|
);
|
|
}
|