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