mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 21:54:32 +00:00
refactor(line): dedupe schedule card header
This commit is contained in:
@@ -28,6 +28,21 @@ function buildTitleSubtitleHeader(params: { title: string; subtitle?: string }):
|
|||||||
return headerContents;
|
return headerContents;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function buildCardHeaderSections(headerContents: FlexComponent[]): FlexComponent[] {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
type: "box",
|
||||||
|
layout: "vertical",
|
||||||
|
contents: headerContents,
|
||||||
|
paddingBottom: "lg",
|
||||||
|
} as FlexBox,
|
||||||
|
{
|
||||||
|
type: "separator",
|
||||||
|
color: "#EEEEEE",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
function createMegaBubbleWithFooter(params: {
|
function createMegaBubbleWithFooter(params: {
|
||||||
bodyContents: FlexComponent[];
|
bodyContents: FlexComponent[];
|
||||||
footer?: string;
|
footer?: string;
|
||||||
@@ -101,16 +116,7 @@ export function createReceiptCard(params: {
|
|||||||
const headerContents = buildTitleSubtitleHeader({ title, subtitle });
|
const headerContents = buildTitleSubtitleHeader({ title, subtitle });
|
||||||
|
|
||||||
const bodyContents: FlexComponent[] = [
|
const bodyContents: FlexComponent[] = [
|
||||||
{
|
...buildCardHeaderSections(headerContents),
|
||||||
type: "box",
|
|
||||||
layout: "vertical",
|
|
||||||
contents: headerContents,
|
|
||||||
paddingBottom: "lg",
|
|
||||||
} as FlexBox,
|
|
||||||
{
|
|
||||||
type: "separator",
|
|
||||||
color: "#EEEEEE",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
type: "box",
|
type: "box",
|
||||||
layout: "vertical",
|
layout: "vertical",
|
||||||
@@ -448,16 +454,7 @@ export function createAgendaCard(params: {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const bodyContents: FlexComponent[] = [
|
const bodyContents: FlexComponent[] = [
|
||||||
{
|
...buildCardHeaderSections(headerContents),
|
||||||
type: "box",
|
|
||||||
layout: "vertical",
|
|
||||||
contents: headerContents,
|
|
||||||
paddingBottom: "lg",
|
|
||||||
} as FlexBox,
|
|
||||||
{
|
|
||||||
type: "separator",
|
|
||||||
color: "#EEEEEE",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
type: "box",
|
type: "box",
|
||||||
layout: "vertical",
|
layout: "vertical",
|
||||||
|
|||||||
Reference in New Issue
Block a user