| b69ab31 | | | 1 | /** |
| b69ab31 | | | 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. |
| b69ab31 | | | 3 | * |
| b69ab31 | | | 4 | * This source code is licensed under the MIT license found in the |
| b69ab31 | | | 5 | * LICENSE file in the root directory of this source tree. |
| b69ab31 | | | 6 | */ |
| b69ab31 | | | 7 | |
| b69ab31 | | | 8 | import * as stylex from '@stylexjs/stylex'; |
| b69ab31 | | | 9 | |
| b69ab31 | | | 10 | const styles = stylex.create({ |
| b69ab31 | | | 11 | button: { |
| b69ab31 | | | 12 | display: 'flex', |
| b69ab31 | | | 13 | alignItems: 'center', |
| b69ab31 | | | 14 | fontSize: '12px', |
| b69ab31 | | | 15 | color: 'var(--vscode-descriptionForeground)', |
| b69ab31 | | | 16 | whiteSpace: 'nowrap', |
| b69ab31 | | | 17 | cursor: 'pointer', |
| b69ab31 | | | 18 | gap: '5px', |
| b69ab31 | | | 19 | boxSizing: 'border-box', |
| b69ab31 | | | 20 | borderBottom: { |
| b69ab31 | | | 21 | default: '1px solid transparent', |
| b69ab31 | | | 22 | ':hover': '1px solid var(--vscode-editor-foreground)', |
| b69ab31 | | | 23 | }, |
| b69ab31 | | | 24 | }, |
| b69ab31 | | | 25 | }); |
| b69ab31 | | | 26 | |
| b69ab31 | | | 27 | export default function ActionLink({ |
| b69ab31 | | | 28 | onClick, |
| b69ab31 | | | 29 | children, |
| b69ab31 | | | 30 | title, |
| b69ab31 | | | 31 | }: { |
| b69ab31 | | | 32 | onClick: () => void; |
| b69ab31 | | | 33 | title?: string; |
| b69ab31 | | | 34 | children: React.ReactNode; |
| b69ab31 | | | 35 | }) { |
| b69ab31 | | | 36 | return ( |
| b69ab31 | | | 37 | <div {...stylex.props(styles.button)} onClick={() => onClick()} title={title}> |
| b69ab31 | | | 38 | {children} |
| b69ab31 | | | 39 | </div> |
| b69ab31 | | | 40 | ); |
| b69ab31 | | | 41 | } |