5bc876e4b4
changes - - make iframe side panel to match others -- ie use SidePanelHeader for title - make url optional in configuration to match that of the other widgets (allow partial saves) - render No data status when error or no url - split widget sizes into two -- graph widget sizes and widget sizes (graph widgets are a subset of chart widgets)
12 lines
439 B
TypeScript
12 lines
439 B
TypeScript
import { DEFAULT_WIDGET_SIZE } from '@/page-layout/constants/DefaultWidgetSize';
|
|
import { GRAPH_WIDGET_SIZES } from '@/page-layout/constants/GraphWidgetSizes';
|
|
import { type GraphType } from '~/generated/graphql';
|
|
|
|
export const getWidgetSize = (
|
|
graphType: GraphType,
|
|
type: 'default' | 'minimum',
|
|
): { w: number; h: number } => {
|
|
const sizeConfig = GRAPH_WIDGET_SIZES[graphType] ?? DEFAULT_WIDGET_SIZE;
|
|
return sizeConfig[type];
|
|
};
|