| 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 type {TrackEventName} from 'isl-server/src/analytics/eventNames'; |
| b69ab31 | | | 9 | import type {CommitInfo} from '../../types'; |
| b69ab31 | | | 10 | |
| b69ab31 | | | 11 | import type {Button} from 'isl-components/Button'; |
| b69ab31 | | | 12 | import {T} from '../../i18n'; |
| b69ab31 | | | 13 | import {SplitCommitIcon} from '../../icons/SplitCommitIcon'; |
| b69ab31 | | | 14 | import {BaseSplitButton} from './BaseSplitButton'; |
| b69ab31 | | | 15 | |
| b69ab31 | | | 16 | /** Button to open split UI for the current commit. Expected to be shown on the head commit. |
| b69ab31 | | | 17 | * Loads that one commit in the split UI. */ |
| b69ab31 | | | 18 | export function SplitButton({ |
| b69ab31 | | | 19 | commit, |
| b69ab31 | | | 20 | trackerEventName, |
| b69ab31 | | | 21 | ...buttonProps |
| b69ab31 | | | 22 | }: { |
| b69ab31 | | | 23 | commit: CommitInfo; |
| b69ab31 | | | 24 | trackerEventName: TrackEventName; |
| b69ab31 | | | 25 | } & React.ComponentProps<typeof Button>) { |
| b69ab31 | | | 26 | return ( |
| b69ab31 | | | 27 | <BaseSplitButton |
| b69ab31 | | | 28 | commit={commit} |
| b69ab31 | | | 29 | trackerEventName={trackerEventName} |
| b69ab31 | | | 30 | bumpSplitFromSuggestion={trackerEventName === 'SplitOpenFromSplitSuggestion'} |
| b69ab31 | | | 31 | {...buttonProps}> |
| b69ab31 | | | 32 | <SplitCommitIcon /> |
| b69ab31 | | | 33 | <T>Split</T> |
| b69ab31 | | | 34 | </BaseSplitButton> |
| b69ab31 | | | 35 | ); |
| b69ab31 | | | 36 | } |