fix: show no invites message (#427)
This commit is contained in:
parent
4a254c55c8
commit
b02adca6db
1 changed files with 57 additions and 37 deletions
|
@ -298,8 +298,16 @@ export default function Invites() {
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<SimpleGrid cols={3} spacing='lg' breakpoints={[{ maxWidth: 'sm', cols: 1, spacing: 'sm' }]}>
|
<SimpleGrid cols={3} spacing='lg' breakpoints={[{ maxWidth: 'sm', cols: 1, spacing: 'sm' }]}>
|
||||||
{invites.length
|
{!ok && !invites.length && (
|
||||||
? invites.map((invite) => (
|
<>
|
||||||
|
{[1, 2, 3].map((x) => (
|
||||||
|
<Skeleton key={x} width='100%' height={100} radius='sm' />
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{invites.length && ok ? (
|
||||||
|
invites.map((invite) => (
|
||||||
<Card key={invite.id} sx={{ maxWidth: '100%' }}>
|
<Card key={invite.id} sx={{ maxWidth: '100%' }}>
|
||||||
<Group position='apart'>
|
<Group position='apart'>
|
||||||
<Group position='left'>
|
<Group position='left'>
|
||||||
|
@ -313,9 +321,7 @@ export default function Invites() {
|
||||||
</Title>
|
</Title>
|
||||||
<Tooltip label={new Date(invite.createdAt).toLocaleString()}>
|
<Tooltip label={new Date(invite.createdAt).toLocaleString()}>
|
||||||
<div>
|
<div>
|
||||||
<MutedText size='sm'>
|
<MutedText size='sm'>Created {relativeTime(new Date(invite.createdAt))}</MutedText>
|
||||||
Created {relativeTime(new Date(invite.createdAt))}
|
|
||||||
</MutedText>
|
|
||||||
</div>
|
</div>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Tooltip label={new Date(invite.expiresAt).toLocaleString()}>
|
<Tooltip label={new Date(invite.expiresAt).toLocaleString()}>
|
||||||
|
@ -336,7 +342,21 @@ export default function Invites() {
|
||||||
</Group>
|
</Group>
|
||||||
</Card>
|
</Card>
|
||||||
))
|
))
|
||||||
: [1, 2, 3].map((x) => <Skeleton key={x} width='100%' height={100} radius='sm' />)}
|
) : (
|
||||||
|
<>
|
||||||
|
<div></div>
|
||||||
|
<Group>
|
||||||
|
<div>
|
||||||
|
<IconTag size={48} />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<Title>Nothing here</Title>
|
||||||
|
<MutedText size='md'>Create some invites and they will show up here</MutedText>
|
||||||
|
</div>
|
||||||
|
</Group>
|
||||||
|
<div></div>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</SimpleGrid>
|
</SimpleGrid>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
|
|
Loading…
Add table
Reference in a new issue