Files
Shortumation/webapp/src/haService/entities.stories.tsx
T
2022-05-30 15:05:54 -04:00

26 lines
679 B
TypeScript

import React, { FC } from "react";
import { ComponentMeta, ComponentStory } from '@storybook/react';
import { Page } from "components/Page";
import { useHAEntities } from "haService";
const Test: FC<{ onRender: () => void }> = ({ onRender }) => {
const conn = useHAEntities();
onRender && onRender()
return <code>
{JSON.stringify(conn, null, 4)}
</code>
}
export default {
title: 'Services/HA Entities',
component: Test,
parameters: { actions: { argTypesRegex: '^on.*' } },
args: {}
} as ComponentMeta<typeof Test>
export const Base: ComponentStory<typeof Test> = props => {
return <Page>
<Test {...props} />
</Page>
};