()
| 28 | } |
| 29 | |
| 30 | export function V2ImportLink() { |
| 31 | const result = useAtomValue(v2ImportAtom); |
| 32 | if (!AsyncResult.isSuccess(result)) return null; |
| 33 | const { url, moved } = result.value; |
| 34 | const link = |
| 35 | moved !== null |
| 36 | ? { |
| 37 | href: moved.v2Url, |
| 38 | label: "Open in Executor v2", |
| 39 | track: () => trackEvent("v2_moved_open_clicked", { via: "sidebar" }), |
| 40 | } |
| 41 | : url !== null |
| 42 | ? { href: url, label: "Move to Executor v2", track: () => trackEvent("v2_import_opened") } |
| 43 | : null; |
| 44 | if (link === null) return null; |
| 45 | return ( |
| 46 | <a |
| 47 | href={link.href} |
| 48 | target="_blank" |
| 49 | rel="noopener noreferrer" |
| 50 | onClick={link.track} |
| 51 | className="flex w-full items-center gap-2.5 rounded-md px-2.5 py-1.5 text-sm text-sidebar-foreground transition-colors hover:bg-sidebar-active/60 hover:text-foreground" |
| 52 | > |
| 53 | <MoveIcon className="size-3.5 text-muted-foreground" /> |
| 54 | {link.label} |
| 55 | </a> |
| 56 | ); |
| 57 | } |
nothing calls this directly
no test coverage detected