@yandex/ui
Version:
Yandex UI components
19 lines (18 loc) • 1.26 kB
JavaScript
import { __read } from "tslib";
import React, { useState } from 'react';
import { select, boolean } from '@storybook/addon-knobs';
import { TabsMenu } from '@yandex-lego/components/TabsMenu/desktop/bundle';
export var Playground = function () {
var _a = __read(useState('search'), 2), activeTab = _a[0], setActiveTab = _a[1];
var view = select('view', ['default', ''], 'default');
var size = select('size', ['m', 's'], 'm');
var theme = view === '' ? select('theme', ['normal'], 'normal') : null;
var adaptive = boolean('adaptive', true);
var staticMoreText = boolean('staticMoreText', true);
var hideMoreIcon = boolean('hideMoreIcon', false);
return (React.createElement(TabsMenu, { layout: "horiz", size: size, theme: theme, view: view, tabs: [
{ id: 'search', onClick: function () { return setActiveTab('search'); }, content: 'Поиск' },
{ id: 'images', onClick: function () { return setActiveTab('images'); }, content: 'Картинки' },
{ id: 'video', onClick: function () { return setActiveTab('video'); }, content: 'Видео' },
], onChange: setActiveTab, activeTab: activeTab, adaptive: adaptive, staticMoreText: staticMoreText, hideMoreIcon: hideMoreIcon }));
};