import React from 'react';
import formatFns from 'date-fns/format';
import ptBR from 'date-fns/locale/pt-BR';

interface IPropsMomentString {
   date: Date; // data
   format: 'dd MM yyyy' | string; // format da data
}

export const DateString: React.FunctionComponent<IPropsMomentString> = ({ date, format }: IPropsMomentString) => {
   return <>{formatFns(date, format, { locale: ptBR })}</>;
};
