Component start
This commit is contained in:
parent
8a4ec39d25
commit
a93b13f448
14
packages/components/src/components/Iframe.tsx
Normal file
14
packages/components/src/components/Iframe.tsx
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import { CSSProperties } from "react";
|
||||||
|
|
||||||
|
export interface IframeProps {
|
||||||
|
url: string;
|
||||||
|
style?: CSSProperties;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function Iframe({
|
||||||
|
url, style
|
||||||
|
}: IframeProps) {
|
||||||
|
return (
|
||||||
|
<iframe src={url} style={style ?? {}}></iframe>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -9,3 +9,4 @@ export * from './components/Map';
|
|||||||
export * from './components/PdfViewer';
|
export * from './components/PdfViewer';
|
||||||
export * from "./components/Excel";
|
export * from "./components/Excel";
|
||||||
export * from "./components/BucketViewer";
|
export * from "./components/BucketViewer";
|
||||||
|
export * from "./components/Iframe";
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { raw, type Meta, type StoryObj } from '@storybook/react';
|
import { type Meta, type StoryObj } from '@storybook/react';
|
||||||
|
|
||||||
import { BucketViewer, BucketViewerData, BucketViewerProps } from '../src/components/BucketViewer';
|
import { BucketViewer, BucketViewerProps } from '../src/components/BucketViewer';
|
||||||
|
|
||||||
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction
|
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction
|
||||||
const meta: Meta = {
|
const meta: Meta = {
|
||||||
|
|||||||
31
packages/components/stories/Iframe.stories.ts
Normal file
31
packages/components/stories/Iframe.stories.ts
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
import { type Meta, type StoryObj } from '@storybook/react';
|
||||||
|
|
||||||
|
import { Iframe, IframeProps } from '../src/components/Iframe';
|
||||||
|
|
||||||
|
const meta: Meta = {
|
||||||
|
title: 'Components/Iframe',
|
||||||
|
component: Iframe,
|
||||||
|
tags: ['autodocs'],
|
||||||
|
argTypes: {
|
||||||
|
url: {
|
||||||
|
description:
|
||||||
|
'Page to display inside of the component',
|
||||||
|
},
|
||||||
|
style: {
|
||||||
|
description:
|
||||||
|
'Style of the component',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default meta;
|
||||||
|
|
||||||
|
type Story = StoryObj<IframeProps>;
|
||||||
|
|
||||||
|
export const Normal: Story = {
|
||||||
|
name: 'Iframe',
|
||||||
|
args: {
|
||||||
|
url: 'https://ssen-smart-meter.datopian.workers.dev',
|
||||||
|
style: {width: `100%`}
|
||||||
|
},
|
||||||
|
};
|
||||||
Loading…
x
Reference in New Issue
Block a user