// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import React, { useState } from 'react'; import { Microphone, Camera, Dialer, Sound, Phone, Laptop } from '../icons'; import ControlBar from '.'; import ControlBarButton from './ControlBarButton'; import PopOverItem from '../PopOver/PopOverItem'; import PopOverSubMenu from '../PopOver/PopOverSubMenu'; import PopOverSeparator from '../PopOver/PopOverSeparator'; import PopOverHeader from '../PopOver/PopOverHeader'; export default { title: 'UI Components/ControlBar', component: ControlBar, excludeStories: ['ControlBarForDocs'], parameters: { layout: 'padded', docs: { source: { code: 'disabled', }, }, }, }; export const ControlBarForDocs = () => { const [muted, setMuted] = useState(false); const [cameraActive, setCameraActive] = useState(false); const microphoneButtonProps = { icon: muted ? : , onClick: () => setMuted(!muted), label: 'Mute', }; const cameraButtonProps = { icon: cameraActive ? : , isSelected: true, popOver: [ { onClick: () => console.log('camera popover option 1'), children: Some option text, }, { onClick: () => console.log('camera popover option 2'), children: More option text, }, ], onClick: () => setCameraActive(!cameraActive), label: 'Camera', }; const dialButtonProps = { icon: , onClick: () => console.log('Toggle dial pad'), label: 'Dial', }; const hangUpButtonProps = { icon: , onClick: () => console.log('End meeting'), label: 'End', }; const volumeButtonProps = { icon: , onClick: () => console.log('Volume button clicked'), popOver: [ { onClick: () => console.log('volume popover option 1'), children: Some option text, }, { onClick: () => console.log('volume popover option 2'), children: More option text, }, ], label: 'Volume', }; const laptopButtonProps = { icon: , onClick: () => console.log('Screen button clicked'), label: 'Screen', }; return ( console.log('clicked')}> Also test content console.log('clicked')}> This is more test content console.log('clicked')}> This is also a submenu component console.log('clicked')}> This is also a submenu component console.log('clicked')}> This has very long text ); }; export const _ControlBar = (args) => { const [muted, setMuted] = useState(false); const [cameraActive, setCameraActive] = useState(false); const microphoneButtonProps = { icon: muted ? : , onClick: () => setMuted(!muted), label: 'Mute', }; const cameraButtonProps = { icon: cameraActive ? : , isSelected: true, popOver: [ { onClick: () => console.log('camera popover option 1'), children: Some option text, }, { onClick: () => console.log('camera popover option 2'), children: More option text, }, ], onClick: () => setCameraActive(!cameraActive), label: 'Camera', }; const dialButtonProps = { icon: , onClick: () => console.log('Toggle dial pad'), label: 'Dial', }; const hangUpButtonProps = { icon: , onClick: () => console.log('End meeting'), label: 'End', }; const volumeButtonProps = { icon: , onClick: () => console.log('Volume button clicked'), popOver: [ { onClick: () => console.log('volume popover option 1'), children: Some option text, }, { onClick: () => console.log('volume popover option 2'), children: More option text, }, ], label: 'Volume', }; const laptopButtonProps = { icon: , onClick: () => console.log('Screen button clicked'), label: 'Screen', }; return ( console.log('clicked')}> This is more test content console.log('clicked')}> Also test content console.log('clicked')}> This is more test content console.log('clicked')}> This is also a submenu component console.log('clicked')}> This is also a submenu component console.log('clicked')}> This is also a submenu component ); }; _ControlBar.argTypes = { showLabels: { control: 'boolean' }, responsive: { control: 'boolean' }, layout: { control: 'select', options: [ 'top', 'bottom', 'right', 'left', 'undocked-horizontal', 'undocked-vertical', ], }, }; _ControlBar.args = { showLabels: true, responsive: true, layout: 'top', }; _ControlBar.story = { name: 'ControlBar', };