quantumai-design-system
Version:
퀀텀에이아이의 디자인 시스템
24 lines (23 loc) • 1.03 kB
JavaScript
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
import { forwardRef, useContext } from 'react';
import { DropDownContext } from './DropDownContext';
var DropDownTrigger = forwardRef(function (props, ref) {
var setShow = useContext(DropDownContext).setShow;
return (_jsx("div", __assign({}, props, { ref: ref, onClick: function (e) {
var _a;
(_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
setShow === null || setShow === void 0 ? void 0 : setShow(function (prev) { return !prev; });
}, children: props.children })));
});
export default DropDownTrigger;