2023-03-29 03:54:53 -04:00
|
|
|
import { useState } from 'react'
|
|
|
|
import ToggleSwitchComponent from '../../js/features/history/components/change-list/toggle-switch'
|
2023-04-26 03:52:25 -04:00
|
|
|
import { ScopeDecorator } from '../decorators/scope'
|
|
|
|
import { HistoryProvider } from '../../js/features/history/context/history-context'
|
2024-10-10 03:26:18 -04:00
|
|
|
import { bsVersionDecorator } from '../../../.storybook/utils/with-bootstrap-switcher'
|
2023-03-29 03:54:53 -04:00
|
|
|
|
2023-05-23 03:54:42 -04:00
|
|
|
export const HistoryAndLabelsToggleSwitch = () => {
|
2023-03-29 03:54:53 -04:00
|
|
|
const [labelsOnly, setLabelsOnly] = useState(false)
|
|
|
|
|
|
|
|
return (
|
2023-04-26 03:52:25 -04:00
|
|
|
<HistoryProvider>
|
|
|
|
<ToggleSwitchComponent
|
|
|
|
labelsOnly={labelsOnly}
|
|
|
|
setLabelsOnly={setLabelsOnly}
|
|
|
|
/>
|
|
|
|
</HistoryProvider>
|
2023-03-29 03:54:53 -04:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default {
|
|
|
|
title: 'History / Change list',
|
|
|
|
component: ToggleSwitchComponent,
|
|
|
|
argTypes: {
|
|
|
|
labelsOnly: {
|
|
|
|
table: {
|
|
|
|
disable: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
setLabelsOnly: {
|
|
|
|
table: {
|
|
|
|
disable: true,
|
|
|
|
},
|
|
|
|
},
|
2024-10-10 03:26:18 -04:00
|
|
|
...bsVersionDecorator.argTypes,
|
2023-03-29 03:54:53 -04:00
|
|
|
},
|
|
|
|
decorators: [
|
2023-04-26 03:52:25 -04:00
|
|
|
ScopeDecorator,
|
2023-03-29 03:54:53 -04:00
|
|
|
(Story: React.ComponentType) => (
|
|
|
|
<div className="history-react">
|
|
|
|
<div className="change-list">
|
2023-04-11 04:35:33 -04:00
|
|
|
<div className="history-header history-toggle-switch-container">
|
2023-03-29 03:54:53 -04:00
|
|
|
<Story />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
),
|
|
|
|
],
|
|
|
|
}
|