import React from 'react';
import format from 'date-fns/format';
import { useConfig } from '../../../../../../utilities/Config';
const DateCell = ({ data, field }) => {
    var _a, _b;
    const { admin: { dateFormat: dateFormatFromConfig } } = useConfig();
    const dateFormat = ((_b = (_a = field === null || field === void 0 ? void 0 : field.admin) === null || _a === void 0 ? void 0 : _a.date) === null || _b === void 0 ? void 0 : _b.displayFormat) || dateFormatFromConfig;
    return (React.createElement("span", null, data && format(new Date(data), dateFormat)));
};
export default DateCell;
