Hide audit report buttons when no file attached
When an audit has no report attached, neither the View nor Request access button should be displayed. Updated the conditional rendering to wrap the entire button section with the audit.report check instead of only checking it in the nested ternary. Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
@@ -121,7 +121,8 @@ export function AuditRow(props: { audit: AuditRowFragment$key }) {
|
|||||||
<IconMedal size={16} className="flex-none text-txt-tertiary" />
|
<IconMedal size={16} className="flex-none text-txt-tertiary" />
|
||||||
{audit.name ?? audit.framework.name}
|
{audit.name ?? audit.framework.name}
|
||||||
</div>
|
</div>
|
||||||
{audit.report && audit.report.isUserAuthorized
|
{audit.report && (
|
||||||
|
audit.report.isUserAuthorized
|
||||||
? (
|
? (
|
||||||
<Button
|
<Button
|
||||||
className="w-full md:w-max"
|
className="w-full md:w-max"
|
||||||
@@ -142,6 +143,7 @@ export function AuditRow(props: { audit: AuditRowFragment$key }) {
|
|||||||
>
|
>
|
||||||
{hasRequested ? __("Access requested") : __("Request access")}
|
{hasRequested ? __("Access requested") : __("Request access")}
|
||||||
</Button>
|
</Button>
|
||||||
|
)
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user