Skip to content

Commit 1cfea90

Browse files
vepsalaclaude
andcommitted
fix: simplify getPadding type to fix TS2345 error
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent d9f2ada commit 1cfea90

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/editor/blocks/button/button-editor.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ function getFontFamily(fontFamily: string | null | undefined) {
2727
return undefined;
2828
}
2929

30-
const getPadding = (padding: ButtonProps['style'] extends { padding?: infer P } ? P : never) =>
31-
padding ? `${(padding as any).top}px ${(padding as any).right}px ${(padding as any).bottom}px ${(padding as any).left}px` : undefined;
30+
const getPadding = (padding: { top: number; right: number; bottom: number; left: number } | null | undefined) =>
31+
padding ? `${padding.top}px ${padding.right}px ${padding.bottom}px ${padding.left}px` : undefined;
3232

3333
function getRoundedCorners(props: ButtonProps['props']) {
3434
const buttonStyle = props?.buttonStyle ?? ButtonPropsDefaults.buttonStyle;

0 commit comments

Comments
 (0)