import Dinero from "dinero.js";
import React, { forwardRef } from "react";

const ReadOnlyFormItem = ({ value, type = "text", onChange }, ref) => {
  if (!value) return null;
  switch (type) {
    case "text":
      return <div>{value}</div>;
    case "currency":
      return (
        <div>{Dinero({ amount: Math.round(value * 100) }).toFormat()}</div>
      );
    default:
      return <div>{value}</div>;
  }
};
export default forwardRef(ReadOnlyFormItem);
