UNPKG

@100mslive/roomkit-react

Version:

![Banner](https://github.com/100mslive/web-sdks/blob/06c65259912db6ccd8617f2ecb6fef51429251ec/prebuilt-banner.png)

47 lines (44 loc) 1.12 kB
import React from 'react'; import { ChevronDownIcon, ChevronUpIcon } from '@100mslive/react-icons'; import { Dropdown, Flex, Text, textEllipsis } from '../../index'; const DialogDropdownTrigger = React.forwardRef(({ title, css, open, icon, titleCSS = {} }, ref) => { return ( <Dropdown.Trigger asChild data-testid={`${title}_selector`} css={{ border: '1px solid $border_bright', bg: '$surface_bright', r: '$1', p: '$6 $9', zIndex: 10, ...css, }} ref={ref} > <Flex css={{ display: 'flex', justifyContent: 'space-between', color: '$on_surface_high', w: '100%', }} > {icon} <Text css={{ color: 'inherit', ...textEllipsis('90%'), flex: '1 1 0', mx: icon ? '$6' : '0', ...titleCSS, }} > {title} </Text> {open ? <ChevronUpIcon /> : <ChevronDownIcon />} </Flex> </Dropdown.Trigger> ); }); export { DialogDropdownTrigger };