Captain is currently in ALPHA. We are happy to get your feedback
SDK
Required Downloads

Module: required-downloads

Table of contents

Functions

Functions

RequiredDownloads

RequiredDownloads(props): false | ReactElement<any, string | JSXElementConstructor<any>>

RequiredDownloads is a component that manages and displays the download progress of required files for an application. It provides user feedback on the status of each download and a button to initiate the downloading process. The component is intended to ensure all necessary files are downloaded for the application to function properly.

Parameters

NameTypeDescription
propsObjectThe properties passed to the RequiredDownloads component.
props.allRequiredDownloadsany[]An array of objects detailing each required download, including label, id, source, destination, and an optional flag to unzip the downloaded file. This component utilizes the useRequiredDownloads hook to track and manage the download states and progress.
props.disableTypographyundefined | booleanIf true, the note will be displayed as plain text instead of using the Typography component.
props.downloadLabelundefined | FunctionA function that returns a custom label for the download button, receiving the current and total required download counts.
props.noteundefined | stringOptional custom message to display about the download requirements.

Returns

false | ReactElement<any, string | JSXElementConstructor<any>>

Example

<RequiredDownloads
  note="Please ensure you download all necessary files to proceed."
  allRequiredDownloads={[
    { label: 'File 1', id: 'file1', source: '/source/file1.zip', destination: '/destination', unzip: true },
    { label: 'File 2', id: 'file2', source: '/source/file2.jpg', destination: '/dest' }
  ]}
/>

Defined in

node_modules/@captn/joy/dist/esm/required-downloads/index.js:36