| 1 | import { PanelRight, PanelRightClose } from "lucide-react"; |
| 2 | import { Tooltip } from "../components/Tooltip"; |
| 3 | import type { Translator } from "../lib/i18n"; |
| 4 | |
| 5 | // Dock collapse/expand toggle, rendered as one of the bar's action buttons. The |
| 6 | // icon alone carries the state — no accent fill, so it reads as a peer of the |
| 7 | // buttons beside it rather than as a highlighted control. |
| 8 | export function DockToggleButton({ renderable, t, onToggle }: { renderable: boolean; t: Translator; onToggle: () => void }) { |
| 9 | return ( |
| 10 | <Tooltip label={renderable ? t("rightDock.collapse") : t("rightDock.expand")}> |
| 11 | <button |
| 12 | className="topicbar__chrome-btn topicbar__chrome-btn--workspace" |
| 13 | type="button" |
| 14 | onClick={onToggle} |
| 15 | aria-label={renderable ? t("rightDock.collapse") : t("rightDock.expand")} |
| 16 | aria-pressed={renderable} |
| 17 | > |
| 18 | {renderable ? <PanelRightClose size={15} /> : <PanelRight size={15} />} |
| 19 | </button> |
| 20 | </Tooltip> |
| 21 | ); |
| 22 | } |
| 23 |