addons/isl/src/stackEdit/ui/SplitButton.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 type {TrackEventName} from 'isl-server/src/analytics/eventNames';
b69ab319import type {CommitInfo} from '../../types';
b69ab3110
b69ab3111import type {Button} from 'isl-components/Button';
b69ab3112import {T} from '../../i18n';
b69ab3113import {SplitCommitIcon} from '../../icons/SplitCommitIcon';
b69ab3114import {BaseSplitButton} from './BaseSplitButton';
b69ab3115
b69ab3116/** Button to open split UI for the current commit. Expected to be shown on the head commit.
b69ab3117 * Loads that one commit in the split UI. */
b69ab3118export function SplitButton({
b69ab3119 commit,
b69ab3120 trackerEventName,
b69ab3121 ...buttonProps
b69ab3122}: {
b69ab3123 commit: CommitInfo;
b69ab3124 trackerEventName: TrackEventName;
b69ab3125} & React.ComponentProps<typeof Button>) {
b69ab3126 return (
b69ab3127 <BaseSplitButton
b69ab3128 commit={commit}
b69ab3129 trackerEventName={trackerEventName}
b69ab3130 bumpSplitFromSuggestion={trackerEventName === 'SplitOpenFromSplitSuggestion'}
b69ab3131 {...buttonProps}>
b69ab3132 <SplitCommitIcon />
b69ab3133 <T>Split</T>
b69ab3134 </BaseSplitButton>
b69ab3135 );
b69ab3136}