({ onConfirm }: { onConfirm: () => void })
| 972 | } |
| 973 | |
| 974 | function DisconnectButton({ onConfirm }: { onConfirm: () => void }) { |
| 975 | const [confirming, setConfirming] = useState(false) |
| 976 | useEffect(() => { |
| 977 | if (!confirming) return |
| 978 | const t = setTimeout(() => setConfirming(false), 3000) |
| 979 | return () => clearTimeout(t) |
| 980 | }, [confirming]) |
| 981 | return ( |
| 982 | <button |
| 983 | type="button" |
| 984 | onClick={() => (confirming ? onConfirm() : setConfirming(true))} |
| 985 | className={cn( |
| 986 | dmSans125ClassName(), |
| 987 | "shrink-0 rounded-md px-2 py-1 text-[11px] font-medium transition-colors", |
| 988 | confirming |
| 989 | ? "bg-red-500/15 text-red-400" |
| 990 | : "text-[#737373] hover:bg-white/5 hover:text-red-400", |
| 991 | )} |
| 992 | > |
| 993 | {confirming ? "Confirm" : "Disconnect"} |
| 994 | </button> |
| 995 | ) |
| 996 | } |
| 997 | |
| 998 | function ActiveButton({ |
| 999 | count, |
nothing calls this directly
no test coverage detected
searching dependent graphs…