import { useMemo, useState } from "react";
import classNames from "classnames";
import { on } from "events";

interface Props {
  value: string;
  onChange: (value: string) => void;
}
export const Parameter: React.FC<Props> = ({ value, onChange }) => {
  const [state, setState] = useState(value);

  return (
    <input
      type="text"
      className="bg-indigo-600 !text-white px-1.5 rounded-md outline-none bg-opacity-80 max-w-[80px] text-center truncate"
      onBlur={() => onChange(state)}
      value={state}
      onChange={(e) => setState(e.target.value)}
    />
  );
};
