@wulperstudio/cms
Version:
Wulper Studio Library Components CMS
30 lines • 1.05 kB
JavaScript
import _extends from "@babel/runtime/helpers/esm/extends";
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, _extends({
direction: "row",
columnGap: 1,
justifyContent: "center",
alignItems: "center"
}, stackProps, {
children: [icon && /*#__PURE__*/_jsx(Icon, _extends({
icon: icon == null ? void 0 : icon.name,
color: icon == null ? void 0 : icon.color
}, icon == null ? void 0 : icon.restProps)), /*#__PURE__*/_jsx(Typography, _extends({
variant: "body1"
}, textProps, {
children: dayjs(date).format(format)
}))]
}));
};
export default TextDate;