import React from 'react' import { ComponentStory, ComponentMeta } from '@storybook/react' import { PromotedIntrospection, PromotedIntrospectionTrigger } from './PromotedIntrospection' import { Card } from '@material-ui/core' import { mockData } from './mocks' export default { title: 'PromotedIntrospection', component: PromotedIntrospection, } as ComponentMeta const SearchItem = () => { return ( Some search result ) } const Template: ComponentStory = (args) => (
) export const Default = Template.bind({}) Default.parameters = { mockData } Default.args = { endpoint: 'www.foo.fake', apiKey: 'api-key', item: { contentId: 'content_id2', logUserId: 'test-loguserid', }, } export const DisplayRight = Template.bind({}) DisplayRight.parameters = { mockData } DisplayRight.args = { endpoint: 'www.foo.fake', apiKey: 'api-key', item: { contentId: 'content_id2', logUserId: 'test-loguserid', }, direction: 'right', } export const CustomTrigger = Template.bind({}) CustomTrigger.parameters = { mockData } CustomTrigger.args = { endpoint: 'www.foo.fake', apiKey: 'api-key', item: { contentId: 'content_id2', logUserId: 'test-loguserid', }, renderTrigger: (onTrigger: () => any) => { return ( ) }, } export const Controlled = () => { const [isOpen, setIsOpen] = React.useState(false) return (
setIsOpen(false)} >
) } Controlled.parameters = { mockData } export const TriggerOverlay = () => { return (
) } TriggerOverlay.parameters = { mockData } export const TriggerOverlayOnHover = () => { return (
) } TriggerOverlayOnHover.parameters = { mockData }