feat: Iframe component API and docs improvements

This commit is contained in:
Demenech
2024-04-09 16:07:12 -03:00
parent 4b5d549190
commit b7ee5a1869
3 changed files with 17 additions and 12 deletions

View File

@@ -7,7 +7,7 @@ import 'ag-grid-community/styles/ag-theme-alpine.css';
import { Data } from '../types/properties';
export type ExcelProps = {
data: Pick<Data, 'url'>;
data: Required<Pick<Data, 'url'>>;
};
export function Excel({ data }: ExcelProps) {

View File

@@ -1,14 +1,17 @@
import { CSSProperties } from "react";
import { CSSProperties } from 'react';
import { Data } from '../types/properties';
export interface IframeProps {
url: string;
data: Required<Pick<Data, 'url'>>;
style?: CSSProperties;
}
export function Iframe({
url, style
}: IframeProps) {
export function Iframe({ data, style }: IframeProps) {
const url = data.url;
return (
<iframe src={url} style={style ?? { width: `100%`, height: `100%` }}></iframe>
<iframe
src={url}
style={style ?? { width: `100%`, height: `100%` }}
></iframe>
);
}