import React from 'react' import { ComponentStory, ComponentMeta } from '@storybook/react' import { PromotedIntrospection } from './PromotedIntrospection/PromotedIntrospection' import { Card } from '@material-ui/core' import { withPromotedIntrospection } from './withPromotedIntrospection' import { mockData } from './PromotedIntrospection/mocks' const BaseComponent = ({ item }: { item: { logUserId: string; contentId: string } }) => ( Some search result with Log User Id {item.logUserId} ) const WithPromotedIntrospection = withPromotedIntrospection({ endpoint: 'www.foo.fake', apiKey: 'apikey', })(BaseComponent) export default { title: 'withPromotedIntrospection', component: WithPromotedIntrospection, } as ComponentMeta const Template: ComponentStory = (args) => (
) export const Default = Template.bind({}) Default.parameters = { mockData, } Default.args = { introspectionEnabled: true, item: { contentId: 'content_id2', logUserId: 'test-loguserid', }, } export const Controlled = () => { const [isOpen, setIsOpen] = React.useState(false) return (
setIsOpen(false)} />
) } Controlled.parameters = { mockData, } export const DisplayRight = Template.bind({}) DisplayRight.parameters = { mockData, } DisplayRight.args = { introspectionEnabled: true, item: { contentId: 'content_id2', logUserId: 'test-loguserid', }, introspectionDirection: 'right', }