mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 09:25:06 +03:00
* 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
36 lines
842 B
TypeScript
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>
|
|
)
|
|
}
|