({ cursor }: { cursor?: string })
| 41 | } |
| 42 | |
| 43 | function PreviousButton({ cursor }: { cursor?: string }) { |
| 44 | const path = useCursorPath(cursor, "backward"); |
| 45 | |
| 46 | return ( |
| 47 | <LinkButton |
| 48 | to={path ?? "#"} |
| 49 | variant={"minimal/small"} |
| 50 | LeadingIcon="arrow-left" |
| 51 | leadingIconClassName="text-text-dimmed" |
| 52 | className={cn( |
| 53 | "flex items-center", |
| 54 | !path && |
| 55 | "cursor-not-allowed opacity-50 group-hover:bg-transparent group-hover:text-text-dimmed" |
| 56 | )} |
| 57 | onClick={(e) => !path && e.preventDefault()} |
| 58 | > |
| 59 | Prev |
| 60 | </LinkButton> |
| 61 | ); |
| 62 | } |
| 63 | |
| 64 | function useCursorPath(cursor: string | undefined, direction: Direction) { |
| 65 | const location = useLocation(); |
nothing calls this directly
no test coverage detected
searching dependent graphs…