Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mapped download button over selectedData.mcap_files #63

Merged
merged 3 commits into from
Nov 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VITE_API_URL=https://api-url:port
VITE_API_URL=api-url:port
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,8 @@ dist-ssr
*.ntvs*
*.njsproj
*.sln
*.sw?
*.sw?

.env
.env.local
.env.*
9 changes: 5 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"storybook": "^8.3.4",
"typescript": "^5.5.3",
"typescript-eslint": "^8.0.1",
"vite": "^5.4.10"
"vite": "^5.4.11"
},
"lint-staged": {
"*.{ts,tsx,js,jsx}": [
Expand Down
25 changes: 14 additions & 11 deletions src/components/PreviewCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,20 @@ function PreviewCard({ selectedData }: PreviewCardProps) {
gap: "10px",
}}
>
<DownloadButton
buttonText="MCAP"
//One file for now -- can make it dynamically read several files at a time
fileName={selectedData.mcap_files[0].file_name}
signedUrl={selectedData.mcap_files[0].signed_url ?? null}
/>
<DownloadButton
buttonText="MAT"
fileName={selectedData.mat_files[0].file_name}
signedUrl={selectedData.mat_files[0].signed_url}
/>
{selectedData.mcap_files.map((item) => (
aesteri marked this conversation as resolved.
Show resolved Hide resolved
<DownloadButton
buttonText="MCAP"
fileName={item.file_name}
signedUrl={item.signed_url ?? null}
/>
))}
{selectedData.mat_files.map((item) => (
<DownloadButton
buttonText="MAT"
fileName={item.file_name}
signedUrl={item.signed_url}
/>
))}
</div>
</>
) : (
Expand Down