import { formatAmount } from "./amount-format";
import { formatDate } from "./date-format";

export const DataFormat = (value: any, type: string) => {
  if (!value) return "";

  switch (type) {
    case "date":
      return formatDate({ date: value, style: "DD-MMM-YYYY" });
    case "amount":
      return formatAmount({
        amount: value,
        decimal: false,
      });
    default:
      return value;
  }
};
