From cc9e3dce87325512294e29a9453abee42530e44d Mon Sep 17 00:00:00 2001 From: danidfra Date: Thu, 5 Sep 2024 19:02:42 -0300 Subject: [PATCH] Create zap-button to zap request --- .../zap/components/zap-button/zap-button.tsx | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 src/features/zap/components/zap-button/zap-button.tsx diff --git a/src/features/zap/components/zap-button/zap-button.tsx b/src/features/zap/components/zap-button/zap-button.tsx new file mode 100644 index 000000000..62fdccad4 --- /dev/null +++ b/src/features/zap/components/zap-button/zap-button.tsx @@ -0,0 +1,59 @@ +import clsx from 'clsx'; +import React from 'react'; + +import { themes } from './useZapButtonStyles'; + +interface IZapButton { + /** Extra class names for the button. */ + className?: string; + /** URL to an SVG icon to render inside the button. */ + icon?: string; + /** Action when the button is clicked. */ + onClick?: (event: React.MouseEvent) => void; + /** Text inside the button. Takes precedence over `children`. */ + text?: React.ReactNode; + /** Styles the button visually with a predefined theme. */ + theme?: keyof typeof themes; + /** Whether this button should submit a form by default. */ + type?: 'button' | 'submit'; +} + +/** Customizable button element with various themes. */ +const ZapButton = React.forwardRef((props, ref): JSX.Element => { + const { + icon, + onClick, + theme = 'secondary', + text, + type = 'button', + className, + } = props; + + const renderButton = () => ( + + ); + + return renderButton(); +}); + +export { + ZapButton as default, + ZapButton, +};