-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from obsidian-confluence/feat/better-completio…
…n-modal
- Loading branch information
Showing
5 changed files
with
174 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import React from "react"; | ||
|
||
export interface FailedFile { | ||
fileName: string; | ||
reason: string; | ||
} | ||
|
||
export interface UploadResults { | ||
successfulUploads: number; | ||
errorMessage: string | null; | ||
failedFiles: FailedFile[]; | ||
} | ||
|
||
export interface UploadResultsProps { | ||
uploadResults: UploadResults; | ||
} | ||
|
||
const UploadResults: React.FC<UploadResultsProps> = ({ uploadResults }) => { | ||
const { successfulUploads, errorMessage, failedFiles } = uploadResults; | ||
|
||
return ( | ||
<div className="upload-results"> | ||
<div> | ||
<h1>Confluence Publish</h1> | ||
</div> | ||
{errorMessage ? ( | ||
<div className="error-message"> | ||
<h3>Error</h3> | ||
<p>{errorMessage}</p> | ||
</div> | ||
) : ( | ||
<> | ||
<div className="successful-uploads"> | ||
<h3>Successful Uploads</h3> | ||
<p> | ||
{successfulUploads} file(s) uploaded successfully. | ||
</p> | ||
</div> | ||
|
||
{failedFiles.length > 0 && ( | ||
<div className="failed-uploads"> | ||
<h3>Failed Uploads</h3> | ||
<p> | ||
{failedFiles.length} file(s) failed to upload. | ||
</p> | ||
<ul> | ||
{failedFiles.map((file, index) => ( | ||
<li key={index}> | ||
<strong>{file.fileName}</strong>:{" "} | ||
{file.reason} | ||
</li> | ||
))} | ||
</ul> | ||
</div> | ||
)} | ||
</> | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
export default UploadResults; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters