"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Story2 = exports.Story1 = void 0;
const react_1 = __importStar(require("react"));
const BaseSegment_1 = require("./BaseSegment");
const ExtendSegment_1 = require("./ExtendSegment");
const Colors_1 = require("../../core/Colors");
/**
 * updated 230523
 *
 * <a href="https://www.notion.so/Segment-Control-6e06058eb43c4615a71bf37d35631043?pvs=4" target="_blank">노션페이지</a>
 * <br/>
 * 하위 정보를 동일하게 분할하여 구성합니다.
 * 기본적으로 첫 번째 세그먼트가 선택되어 있고 사용자는 나머지 세그먼트를 선택할 수 있습니다.
 *
 */
const meta = {
    title: 'Component/Segment',
    component: BaseSegment_1.Segment,
    tags: ['autodocs'],
};
exports.default = meta;
const BaseSegmentComp = (props) => {
    const [value, setValue] = (0, react_1.useState)(props.item[0]);
    const onChange = (val) => {
        setValue(val);
    };
    return (react_1.default.createElement(react_1.default.Fragment, null,
        "selected: ",
        value,
        react_1.default.createElement("br", null),
        react_1.default.createElement("br", null),
        react_1.default.createElement(BaseSegment_1.Segment, Object.assign({}, props, { value: value, onChange: onChange }))));
};
// Props 교체 가능
exports.Story1 = {
    render: (props) => (react_1.default.createElement("div", { style: { width: '600px' } },
        react_1.default.createElement(BaseSegmentComp, Object.assign({}, props)))),
    args: {
        item: ['One', 'Two', 'Three'],
    },
    argTypes: {
        onChange: { action: 'onChange' },
    },
};
exports.Story1.storyName = 'Segment - 문자열 리스트';
const ExtendSegmentComp = (props) => {
    const [value, setValue] = (0, react_1.useState)(props.item[0].value);
    const onChange = (val) => {
        setValue(val);
    };
    return (react_1.default.createElement(react_1.default.Fragment, null,
        "selected: ",
        value,
        react_1.default.createElement("br", null),
        react_1.default.createElement("br", null),
        react_1.default.createElement(ExtendSegment_1.ExtendSegment, Object.assign({}, props, { value: value, onChange: onChange }))));
};
exports.Story2 = {
    render: (props) => (react_1.default.createElement("div", { style: { width: '600px' } },
        react_1.default.createElement(ExtendSegmentComp, Object.assign({}, props)))),
    args: {
        item: [
            {
                value: '부정',
                children: (react_1.default.createElement(react_1.default.Fragment, null,
                    react_1.default.createElement("div", null, "\uBD80\uC815"),
                    react_1.default.createElement("div", { style: { color: Colors_1.basicColors.red300, paddingLeft: '5px' } }, "4"))),
            },
            {
                value: '긍정',
                children: (react_1.default.createElement(react_1.default.Fragment, null,
                    react_1.default.createElement("div", null, "\uAE0D\uC815"),
                    react_1.default.createElement("div", { style: { color: '#6EED81', paddingLeft: '5px' } }, "1"))),
            },
        ],
    },
    argTypes: {
        onChange: { action: 'onChange' },
    },
};
exports.Story2.storyName = 'Segment - 컴포넌트 리스트';
