'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var React = require('react');

const START = 0;

const useTrimText = (text, max) => {
  const newText = React.useMemo(() => {
    if (text.length < max) {
      return text;
    }

    return text.slice(START, max).concat("...");
  }, [max, text]);
  return newText;
};

exports["default"] = useTrimText;
