// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import React, {useState} from 'react' import Select from 'react-select' import {CSSObject} from '@emotion/serialize' import {getSelectBaseStyle} from '../../theme' import * as registry from './blocks/' import {ContentType} from './blocks/types' type Props = { onChange: (value: string) => void onChangeType: (blockType: ContentType) => void onSave: (value: string, blockType: string) => void value: string } const baseStyles = getSelectBaseStyle() const styles = { ...baseStyles, control: (provided: CSSObject): CSSObject => ({ ...provided, width: '100%', height: '100%', display: 'flex', background: 'rgb(var(--center-channel-bg-rgb))', color: 'rgb(var(--center-channel-color-rgb))', flexDirection: 'row', }), input: (provided: CSSObject): CSSObject => ({ ...provided, background: 'rgb(var(--center-channel-bg-rgb))', color: 'rgb(var(--center-channel-color-rgb))', }), menu: (provided: CSSObject): CSSObject => ({ ...provided, minWidth: '100%', width: 'max-content', background: 'rgb(var(--center-channel-bg-rgb))', left: '0', marginBottom: '0', }), menuPortal: (provided: CSSObject): CSSObject => ({ ...provided, zIndex: 999, }), } export default function RootInput(props: Props) { const [showMenu, setShowMenu] = useState(false) return (