From 6e231c1937211df0f961543b6b54a93fabf3ff65 Mon Sep 17 00:00:00 2001 From: CorrectRoadH Date: Thu, 15 Aug 2024 10:52:55 +0800 Subject: [PATCH] feat: add more update func --- pkg/ysk/adapter.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pkg/ysk/adapter.go b/pkg/ysk/adapter.go index 5fe82a1..0be496e 100644 --- a/pkg/ysk/adapter.go +++ b/pkg/ysk/adapter.go @@ -75,6 +75,20 @@ func (yskCard YSKCard) WithList(params []YSKCardListItem) YSKCard { return yskCard } +func (yskCard YSKCard) WithIconText(icon YSKCardIcon, description string) YSKCard { + yskCard.Content.BodyIconWithText = &YSKCardIconWithText{ + Icon: icon, + Description: description, + } + return yskCard +} + +// replace the all old action +func (yskCard YSKCard) WithFooterActions(actions []YSKCardFooterAction) YSKCard { + yskCard.Content.FooterActions = actions + return yskCard +} + // it will replace the old action by same side and style func (YSKCard YSKCard) UpsertFooterAction(action YSKCardFooterAction) YSKCard { for i, a := range YSKCard.Content.FooterActions {