74 lines
1.8 KiB
TypeScript
74 lines
1.8 KiB
TypeScript
import { ViewStyle } from "react-native";
|
|
import { AnalyticsEvent, CtaData } from "../..";
|
|
import { GenericActionPayload } from "../../../actions/GenericAction";
|
|
import { GenericWidgetData } from "../Widget";
|
|
import { ImageFieldData, TextFieldData } from "./TitleWidgetData";
|
|
|
|
export interface Column {
|
|
title: TextFieldData;
|
|
subtitle: TextFieldData;
|
|
image?: ImageFieldData;
|
|
columnStyle?: ViewStyle;
|
|
}
|
|
|
|
export interface Cell {
|
|
title?: TextFieldData;
|
|
subtitle?: TextFieldData;
|
|
image?: ImageFieldData;
|
|
cta?: CtaData;
|
|
analyticEvents?: CellAnalyticEvents;
|
|
action?: GenericActionPayload;
|
|
cellStyle?: ViewStyle;
|
|
}
|
|
export interface Row {
|
|
cells?: Cell[];
|
|
rowStyle?: ViewStyle;
|
|
analyticEvents?: CellAnalyticEvents;
|
|
}
|
|
export interface TableWidgetData extends GenericWidgetData {
|
|
rowsToDisplay?: number;
|
|
viewButton?: TextFieldData;
|
|
columns?: Column[];
|
|
rows?: Row[];
|
|
}
|
|
|
|
export interface TableWidgetProps {
|
|
widgetData: TableWidgetData;
|
|
widgetStyle: ViewStyle;
|
|
handleActions: (
|
|
value?: any | undefined | null,
|
|
screenActionPayload?: GenericActionPayload,
|
|
) => void;
|
|
handleClick?: (cta: CtaData) => void;
|
|
widgetIndex?: number;
|
|
}
|
|
|
|
export interface ColumnsProps {
|
|
widgetData?: TableWidgetData;
|
|
}
|
|
|
|
export interface RowsProps {
|
|
widgetData?: TableWidgetData;
|
|
rowsToDisplay?: number;
|
|
handleClick?: (cta: CtaData) => void;
|
|
handleActions: (
|
|
value?: any | undefined | null,
|
|
screenActionPayload?: GenericActionPayload,
|
|
) => void;
|
|
}
|
|
|
|
export interface CellProps {
|
|
widgetData?: TableWidgetData;
|
|
cell?: Cell;
|
|
index: number;
|
|
handleClick?: (cta: CtaData) => void;
|
|
handleActions: (
|
|
value?: any | undefined | null,
|
|
screenActionPayload?: GenericActionPayload,
|
|
) => void;
|
|
}
|
|
|
|
export interface CellAnalyticEvents {
|
|
onViewEvent?: AnalyticsEvent;
|
|
}
|