import styled from '@emotion/styled'; import { ChangeEvent, useRef } from 'react'; import { textInputStyle } from '../../layout/styles/themes'; type OwnProps = { leftValue: string; rightValue: string; leftValuePlaceholder: string; rightValuePlaceholder: string; onChange: (leftValue: string, rightValue: string) => void; }; const StyledContainer = styled.div` display: flex; justify-content: space-between; align-items: center; & > input:last-child { padding-left: ${(props) => props.theme.spacing(2)}; border-left: 1px solid ${(props) => props.theme.primaryBorder}; } `; const StyledEditInplaceInput = styled.input` width: 45%; height: 18px; ${textInputStyle} `; export function DoubleTextInput({ leftValue, rightValue, leftValuePlaceholder, rightValuePlaceholder, onChange, }: OwnProps) { const firstValueInputRef = useRef(null); return ( ) => { onChange(event.target.value, rightValue); }} /> ) => { onChange(leftValue, event.target.value); }} /> ); }