import React, { useContext } from 'react'; import { ICommand } from '@uiw/react-markdown-editor'; import styled from 'styled-components'; import { Context } from '../store/context'; const Input = styled.input` position: absolute; opacity: 0; height: 20px; width: 20px; `; const Button = styled.button``; const ColorView: React.FC<{}> = (props) => { const { preColor, setPreColor } = useContext(Context); const handleChange = (evn: React.ChangeEvent) => { setPreColor(evn.target.value); }; const color = preColor ? preColor : 'currentColor'; return ( ); }; export const colorCommand: ICommand = { name: 'color', keyCommand: 'color', button: () => , };