addons/components/ActionLink.tsxblame
View source
b69ab311/**
b69ab312 * Copyright (c) Meta Platforms, Inc. and affiliates.
b69ab313 *
b69ab314 * This source code is licensed under the MIT license found in the
b69ab315 * LICENSE file in the root directory of this source tree.
b69ab316 */
b69ab317
b69ab318import * as stylex from '@stylexjs/stylex';
b69ab319
b69ab3110const styles = stylex.create({
b69ab3111 button: {
b69ab3112 display: 'flex',
b69ab3113 alignItems: 'center',
b69ab3114 fontSize: '12px',
b69ab3115 color: 'var(--vscode-descriptionForeground)',
b69ab3116 whiteSpace: 'nowrap',
b69ab3117 cursor: 'pointer',
b69ab3118 gap: '5px',
b69ab3119 boxSizing: 'border-box',
b69ab3120 borderBottom: {
b69ab3121 default: '1px solid transparent',
b69ab3122 ':hover': '1px solid var(--vscode-editor-foreground)',
b69ab3123 },
b69ab3124 },
b69ab3125});
b69ab3126
b69ab3127export default function ActionLink({
b69ab3128 onClick,
b69ab3129 children,
b69ab3130 title,
b69ab3131}: {
b69ab3132 onClick: () => void;
b69ab3133 title?: string;
b69ab3134 children: React.ReactNode;
b69ab3135}) {
b69ab3136 return (
b69ab3137 <div {...stylex.props(styles.button)} onClick={() => onClick()} title={title}>
b69ab3138 {children}
b69ab3139 </div>
b69ab3140 );
b69ab3141}