| 1 | "use client"; |
| 2 | |
| 3 | import { useLastLoginMethod } from |
| 4 | |
| 5 | import { Badge } |
| 6 | |
| 7 | export type LastUsedBadgeProps |
| 8 | method: string |
| 9 | compact?: boolean |
| 10 | /** Float the compact indicator over the top-right edge of its container. */ |
| 11 | floating?: boolean |
| 12 | }; |
| 13 | |
| 14 | export function LastUsedBadge({ |
| 15 | method, |
| 16 | compact, |
| 17 | floating, |
| 18 | }: LastUsedBadgeProps) |
| 19 | const { method: |
| 20 | const methods = |
| 21 | |
| 22 | if (!lastLoginMethod || |
| 23 | |
| 24 | return ( |
| 25 | <Badge |
| 26 | className={ |
| 27 | floating |
| 28 | ? "pointer-events-none absolute top-0 right-0 z-10 translate-x-1/4 -translate-y-1/2 shadow-sm" |
| 29 | : undefined |
| 30 | } |
| 31 | variant="secondary" |
| 32 | > |
| 33 | {compact || floating |
| 34 | </Badge> |
| 35 | ); |
| 36 | } |