quantumai-design-system
Version:
퀀텀에이아이의 디자인 시스템
11 lines (10 loc) • 1.02 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
import Icons from '../../Base/Icon/Icons';
import { getMonth, getYear } from 'date-fns';
import { DatePickerHeaderContainer } from './styles';
var DatePickerHeader = function (_a) {
var date = _a.date, decreaseMonth = _a.decreaseMonth, increaseMonth = _a.increaseMonth, customHeaderCount = _a.customHeaderCount, monthDate = _a.monthDate, _b = _a.viewCount, viewCount = _b === void 0 ? 1 : _b;
var month = getMonth(monthDate) + 1 + '';
return (_jsxs(DatePickerHeaderContainer, { viewCount: viewCount, customHeaderCount: customHeaderCount, children: [_jsx("button", { type: "button", children: _jsx(Icons, { name: "arrowLeft", size: 20, onClick: decreaseMonth }) }), _jsx("h2", { children: "".concat(getYear(date), ".").concat(month.length === 1 ? '0' : '').concat(month) }), _jsx("button", { type: "button", children: _jsx(Icons, { name: "arrowRight", size: 20, onClick: increaseMonth }) })] }));
};
export default DatePickerHeader;