import { IBaseMessageProps } from '@/components/message-chat/base';
import { getScrollItemId } from '@/utils/common';
import { formatTime } from '@/utils/time';

import './index.less';

interface IProps extends IBaseMessageProps {}

const PREFIX = 'time-message';

function TimeMessage(props: IProps) {
  const { id, message } = props;
  return (
    <div className={PREFIX} id={getScrollItemId(id)}>
      {formatTime(message.content, 'MM-DD HH:mm')}
    </div>
  );
}

export default TimeMessage;
