import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
import "react";
import * as __WEBPACK_EXTERNAL_MODULE__tachybase_schema__ from "@tachybase/schema";
import * as __WEBPACK_EXTERNAL_MODULE__tachybase_utils_client__ from "@tachybase/utils/client";
import * as __WEBPACK_EXTERNAL_MODULE_classnames__ from "classnames";
import * as __WEBPACK_EXTERNAL_MODULE_dayjs__ from "dayjs";
import * as __WEBPACK_EXTERNAL_MODULE__builtins_index_mjs__ from "../__builtins__/index.mjs";
const ReadPretty = ()=>null;
ReadPretty.DatePicker = function(props) {
    const prefixCls = (0, __WEBPACK_EXTERNAL_MODULE__builtins_index_mjs__.usePrefixCls)('description-date-picker', props);
    if (!props.value) return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {});
    const getLabels = ()=>{
        const format = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_utils_client__.getDefaultFormat)(props);
        const m = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_utils_client__.str2moment)(props.value, props);
        const labels = __WEBPACK_EXTERNAL_MODULE_dayjs__["default"].isDayjs(m) ? m.format(format) : '';
        return (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.isArr)(labels) ? labels.join('~') : labels;
    };
    return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
        className: (0, __WEBPACK_EXTERNAL_MODULE_classnames__["default"])(prefixCls, props.className),
        children: getLabels()
    });
};
ReadPretty.DateRangePicker = function(props) {
    const prefixCls = (0, __WEBPACK_EXTERNAL_MODULE__builtins_index_mjs__.usePrefixCls)('description-text', props);
    const format = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_utils_client__.getDefaultFormat)(props);
    const getLabels = ()=>{
        const m = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_utils_client__.str2moment)(props.value, props);
        if (!m) return '';
        const labels = m.map((m)=>m.format(format));
        return (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.isArr)(labels) ? labels.join('~') : labels;
    };
    return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
        className: (0, __WEBPACK_EXTERNAL_MODULE_classnames__["default"])(prefixCls, props.className),
        style: props.style,
        children: getLabels()
    });
};
export { ReadPretty };
