import {Channel} from '@common/channels/channel'; import {Trans} from '@common/i18n/trans'; import { Menu, MenuItem, MenuTrigger, } from '@common/ui/navigation/menu/menu-trigger'; import {useChannelLayouts} from '@app/channels/channel-header/use-channel-layouts'; import {Button} from '@common/ui/buttons/button'; import {IconButton} from '@common/ui/buttons/icon-button'; import {GridViewIcon} from '@common/icons/material/GridView'; interface Props { channel: Channel; } export function ChannelLayoutButton({channel}: Props) { const {selectedLayout, setSelectedLayout, availableLayouts} = useChannelLayouts(channel); if (availableLayouts?.length < 2) { return null; } const layoutConfig = availableLayouts?.find( method => method.key === selectedLayout ); return ( setSelectedLayout(newValue as string)} > {layoutConfig?.icon || } {availableLayouts?.map(method => ( ))} ); }