🐛 fix(ApiKeysPage): handle cases where keysList.current is null or undefined to prevent errors
✨ feat(ApiKeysPage): add conditional rendering for keysList.current to display appropriate messages when there are no keys assigned or when loading keys
This commit is contained in:
parent
048ea7f743
commit
b70d5501a2
1 changed files with 108 additions and 103 deletions
|
|
@ -103,11 +103,14 @@ export default function ApiKeysPage() {
|
||||||
<div className="flex items-center space-x-2"></div>
|
<div className="flex items-center space-x-2"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{keysList.current.length === 0 && !loadingKeys && (
|
{keysList.current &&
|
||||||
|
keysList.current.length === 0 &&
|
||||||
|
!loadingKeys && (
|
||||||
<>
|
<>
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<h2>
|
<h2>
|
||||||
This user does not have any keys assigned at the moment.
|
This user does not have any keys assigned at the
|
||||||
|
moment.
|
||||||
</h2>
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
|
|
@ -124,7 +127,9 @@ export default function ApiKeysPage() {
|
||||||
(loadingKeys ? " border-0" : "")
|
(loadingKeys ? " border-0" : "")
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{keysList.current.length > 0 && !loadingKeys && (
|
{keysList.current &&
|
||||||
|
keysList.current.length > 0 &&
|
||||||
|
!loadingKeys && (
|
||||||
<Table className={"table-fixed bg-muted outline-1"}>
|
<Table className={"table-fixed bg-muted outline-1"}>
|
||||||
<TableHeader
|
<TableHeader
|
||||||
className={
|
className={
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue