AlexsLemonade / refinebio-web

Refinebio Web
https://staging.web.refine.bio
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Add getDatasetState helper for the dataset lifecycle #370

Open nozomione opened 1 month ago

nozomione commented 1 month ago

Context

Epic: #358

Dependency: #361 A PR for this issue will be based off the above issue's PR branch. (Due to frequent edits to the same files, the above dependency was added to this issue to minimize merge conflicts.)

In /download and dataset routes, we render the UI based on the dataset lifecycle states which include unprocessed, processing, processed (unexpired or expired), and processing error.

Currently, we set these values by destructuring dataset and creating all the appropriate variables within the components for conditional UI rendering logic.

Problem or idea

This approach clutters each component's implementation. Thus, we should create a dedicated helper to handle the assignments of these dataset lifecycle states. This will improve the readability and maintainability of our codebase.

Solution or next step