From 2b4ce58df3cd144c7deb7d75b8d481f62467979e Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Fri, 22 Nov 2024 14:35:43 +0100 Subject: [PATCH] UI/components/button: fixup props splitting --- .../app/src/components/button/index.tsx | 33 +++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/pkgs/webview-ui/app/src/components/button/index.tsx b/pkgs/webview-ui/app/src/components/button/index.tsx index f3ec97486..8502e2e2e 100644 --- a/pkgs/webview-ui/app/src/components/button/index.tsx +++ b/pkgs/webview-ui/app/src/components/button/index.tsx @@ -1,4 +1,4 @@ -import { type JSX } from "solid-js"; +import { splitProps, type JSX } from "solid-js"; import cx from "classnames"; type Variants = "dark" | "light"; @@ -45,32 +45,31 @@ interface ButtonProps extends JSX.ButtonHTMLAttributes { class?: string; } export const Button = (props: ButtonProps) => { - const { - children, - variant = "dark", - size = "default", - startIcon, - endIcon, - class: extraClass = "", - ...buttonProps - } = props; + const [local, other] = splitProps(props, [ + "children", + "variant", + "size", + "startIcon", + "endIcon", + "class", + ]); return ( ); };