ds-markdown
Version:
> π React Markdown ζεε¨η»η»δ»ΆοΌζδΎη°δ»£θ倩ηι’ζζ
10 lines β’ 594 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import './index.css';
const Segmented = ({ Segmented: segments, value, onChange }) => {
const handleClick = (itemValue) => {
onChange === null || onChange === void 0 ? void 0 : onChange(itemValue);
};
return (_jsx("div", { className: "ds-segmented-container", children: segments.map((item) => (_jsx("div", { className: `ds-segmented-item ${value === item.value ? 'active' : ''}`, onClick: () => handleClick(item.value), children: item.label }, item.value))) }));
};
export default Segmented;
//# sourceMappingURL=index.js.map