OHIF-252: "Recent" and "All" tabs should be disabled if there are no studies on their category (#1859)
* OHIF-252: "Recent" and "All" tabs should be disabled if there are no studies on their category * fix button props and avoid onClick on disabled state
This commit is contained in:
1 parent
454474ddb4
commit
cf91b0f942
2 files changed
+8
-3
No files matched your search
@@ -79,8 +79,9 @@ const StudyBrowser = ({
|
||||
className="border rounded-md border-secondary-light"
|
||||
>
|
||||
{tabs.map(tab => {
|
||||
const { name, label } = tab;
|
||||
const { name, label, studies } = tab;
|
||||
const isActive = activeTabName === name;
|
||||
const isDisabled = !studies.length;
|
||||
return (
|
||||
<Button
|
||||
key={name}
|
||||
@@ -92,6 +93,7 @@ const StudyBrowser = ({
|
||||
onClick={() => {
|
||||
onClickTab(name);
|
||||
}}
|
||||
disabled={isDisabled}
|
||||
>
|
||||
{label}
|
||||
</Button>
|
||||
|
||||
Reference in new issue
Block a user