Files
supabase/apps/studio/components/interfaces/SignIn/LastSignInWrapper.tsx
T
Danny White 6a4814c2a4 chore(studio): better empty states for new users (#41044)
* box-plus icon

* design-system updates

* new project empty state

* org empty state

* better /organization empty state

* add missing dependency

* fix admonition

* remove prop

* fix badge

* use org slug

* clarify

* org note found cleanup
2025-12-04 20:27:47 +11:00

36 lines
842 B
TypeScript

import { LastSignInType, useLastSignIn } from 'hooks/misc/useLastSignIn'
import { ReactNode } from 'react'
import { Badge, cn } from 'ui'
export function LastSignInWrapper({
children,
type,
}: {
children: ReactNode
type: LastSignInType
}) {
const [lastSignIn] = useLastSignIn()
return (
<div className="flex items-center relative">
{lastSignIn === type && (
<Badge
variant="success"
className="absolute -right-4 -top-3 shadow z-10 bg-brand-400 bg-opacity-100 text-foreground pointer-events-none"
>
Last used
</Badge>
)}
<div
className={cn('w-full', {
'outline outline-1 outline-offset-4 outline-foreground-lighter/50 rounded-md ':
lastSignIn === type,
})}
>
{children}
</div>
</div>
)
}