| 1 | import type { ComponentProps, ReactNode } from "react"; |
| 2 | |
| 3 | export function DiscoveryList({ children }: { readonly children: ReactNode }) { |
| 4 | return ( |
| 5 | <div className="flex flex-col divide-y divide-border/60 overflow-hidden rounded-xl border border-border/70 bg-background"> |
| 6 | {children} |
| 7 | </div> |
| 8 | ); |
| 9 | } |
| 10 | |
| 11 | export function DiscoveryListRow({ |
| 12 | icon, |
| 13 | title, |
| 14 | description, |
| 15 | action, |
| 16 | ...props |
| 17 | }: Omit<ComponentProps<"button">, "title" | "children" | "className"> & { |
| 18 | readonly icon: ReactNode; |
| 19 | readonly title: ReactNode; |
| 20 | readonly description: ReactNode; |
| 21 | readonly action?: ReactNode; |
| 22 | }) { |
| 23 | return ( |
| 24 | <button |
| 25 | type="button" |
| 26 | {...props} |
| 27 | className="group flex w-full items-center gap-3 px-3 py-3 text-left hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-64" |
| 28 | > |
| 29 | {icon} |
| 30 | <div className="flex min-w-0 flex-1 flex-col"> |
| 31 | <span className="truncate text-sm font-medium text-foreground">{title}</span> |
| 32 | <span className="truncate text-xs text-muted-foreground">{description}</span> |
| 33 | </div> |
| 34 | {action} |
| 35 | </button> |
| 36 | ); |
| 37 | } |