quantumai-design-system
Version:
퀀텀에이아이의 디자인 시스템
13 lines (12 loc) • 1.24 kB
JavaScript
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
import { forwardRef } from 'react';
import Icons from '../../Base/Icon/Icons';
import { methodsDatePickerInput } from './methods';
import { DatePickerInputContainer } from './styles';
var DatePickerInput = forwardRef(function (_a, ref) {
var value = _a.value, onClick = _a.onClick, isOpen = _a.isOpen, _b = _a.inputType, inputType = _b === void 0 ? 'range' : _b, _c = _a.inputTitle, inputTitle = _c === void 0 ? 'Category' : _c, _d = _a.titleMaxLength, titleMaxLength = _d === void 0 ? 15 : _d;
var titleFormat = methodsDatePickerInput.titleFormat, valueFormat = methodsDatePickerInput.valueFormat;
var _e = valueFormat(value), startDate = _e[0], endDate = _e[1];
return (_jsxs(DatePickerInputContainer, { isOpen: isOpen, inputType: inputType, onClick: onClick, ref: ref, children: [_jsx(Icons, { name: "calendar" }), inputType === 'single' && _jsx("span", { children: titleFormat(inputTitle, titleMaxLength) }), _jsx("strong", { children: startDate }), inputType === 'range' && (_jsxs(_Fragment, { children: [_jsx("span", { children: "To" }), _jsx("strong", { children: endDate })] }))] }));
});
export default DatePickerInput;