UNPKG

@wulperstudio/cms

Version:
29 lines 1 kB
import React from 'react'; import dayjs from 'dayjs'; import { Icon } from '@iconify/react'; import { Typography, Stack } from '@mui/material'; import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; var TextDate = function TextDate(_ref) { var date = _ref.date, _ref$format = _ref.format, format = _ref$format === void 0 ? 'DD/MM/YYYY' : _ref$format, icon = _ref.icon, textProps = _ref.textProps, stackProps = _ref.stackProps; return /*#__PURE__*/_jsxs(Stack, Object.assign({ direction: "row", columnGap: 1, justifyContent: "center", alignItems: "center" }, stackProps, { children: [icon && /*#__PURE__*/_jsx(Icon, Object.assign({ icon: icon == null ? void 0 : icon.name, color: icon == null ? void 0 : icon.color }, icon == null ? void 0 : icon.restProps)), /*#__PURE__*/_jsx(Typography, Object.assign({ variant: "body1" }, textProps, { children: dayjs(date).format(format) }))] })); }; export default TextDate;