Skip to content

Commit

Permalink
fix: verify before display
Browse files Browse the repository at this point in the history
  • Loading branch information
andrefelizardo committed Jan 9, 2024
1 parent 80e203a commit 95e5c5e
Showing 1 changed file with 19 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,25 @@ export default function WidgetKey({ orgId }: { orgId: string }) {

return (
<>
{widgetKeyMutation.isSuccess && widgetKeyMutation.data && (
<Card sx={{ width: '100%' }} variant="outlined">
<CardHeader
titleTypographyProps={{
variant: 'subtitle1',
fontWeight: 'bold',
}}
title={settings.developer_portal.widget_key}
action={<CopyButton text={widgetKeyMutation.data.item.accessId} />}
/>
<CardContent>
<Typography>{widgetKeyMutation.data.item.accessId}</Typography>
</CardContent>
</Card>
)}
{widgetKeyMutation.isSuccess &&
widgetKeyMutation.data &&
widgetKeyMutation.data.item && (
<Card sx={{ width: '100%' }} variant="outlined">
<CardHeader
titleTypographyProps={{
variant: 'subtitle1',
fontWeight: 'bold',
}}
title={settings.developer_portal.widget_key}
action={
<CopyButton text={widgetKeyMutation.data.item.accessId} />
}
/>
<CardContent>
<Typography>{widgetKeyMutation.data.item.accessId}</Typography>
</CardContent>
</Card>
)}
</>
);
}

0 comments on commit 95e5c5e

Please sign in to comment.