Skip to content

Commit

Permalink
Updates the error render component
Browse files Browse the repository at this point in the history
Signed-off-by: Darshit Chanpura <[email protected]>
  • Loading branch information
DarshitChanpura committed May 25, 2024
1 parent 18d8948 commit ffe27b4
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions public/apps/access-error-component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,7 @@ export const AccessErrorComponent: React.FC<AccessErrorComponentProps> = (props)
message = 'You do not have permissions to view this data',
} = props;

return loading ? (
<EuiLoadingContent />
) : (
<EuiPageContent>
{message}
{dataSourceLabel ? ` for ${props.dataSourceLabel}.` : '.'}
</EuiPageContent>
);
const displayMessage = message + (dataSourceLabel ? ` for ${props.dataSourceLabel}.` : '.');

return loading ? <EuiLoadingContent /> : <EuiPageContent>{displayMessage}</EuiPageContent>;
};

0 comments on commit ffe27b4

Please sign in to comment.