-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy pathTelephoneKeypadToolbarButton.tsx
More file actions
31 lines (24 loc) · 1.02 KB
/
TelephoneKeypadToolbarButton.tsx
File metadata and controls
31 lines (24 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import { hooks } from 'botframework-webchat';
import React, { memo, useCallback } from 'react';
import testIds from '../../testIds';
import { FluentIcon } from '../icon';
import { useTelephoneKeypadShown } from '../telephoneKeypad';
import { ToolbarButton } from './Toolbar';
const { useLocalizer } = hooks;
const TelephoneKeypadToolbarButton = memo(() => {
const [telephoneKeypadShown, setTelephoneKeypadShown] = useTelephoneKeypadShown();
const localize = useLocalizer();
const handleClick = useCallback(() => setTelephoneKeypadShown(shown => !shown), [setTelephoneKeypadShown]);
return (
<ToolbarButton
aria-label={localize('TEXT_INPUT_TELEPHONE_KEYPAD_BUTTON_ALT')}
data-testid={testIds.sendBoxTelephoneKeypadToolbarButton}
onClick={handleClick}
selected={telephoneKeypadShown}
>
<FluentIcon appearance="text" icon="keypad" />
</ToolbarButton>
);
});
TelephoneKeypadToolbarButton.displayName = 'SendBox.TelephoneKeypadToolbarButton';
export default TelephoneKeypadToolbarButton;