This is an automated email from the ASF dual-hosted git repository.
rusackas pushed a commit to branch gpt-component-dosctrings
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/gpt-component-dosctrings by
this push:
new e65ca4c522 chore(gpt): adding docstrings to components.
e65ca4c522 is described below
commit e65ca4c5229bab5a2b76910bdf333e4229ef3c38
Author: Evan Rusackas <[email protected]>
AuthorDate: Sun May 21 22:45:08 2023 -0600
chore(gpt): adding docstrings to components.
---
.../src/components/DropdownButton/index.tsx | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/superset-frontend/src/components/DropdownButton/index.tsx
b/superset-frontend/src/components/DropdownButton/index.tsx
index c6293f66a3..7c3ba7cb29 100644
--- a/superset-frontend/src/components/DropdownButton/index.tsx
+++ b/superset-frontend/src/components/DropdownButton/index.tsx
@@ -73,12 +73,32 @@ export interface DropdownButtonProps {
buttonsRender?: ((buttons: ReactNode[]) => ReactNode[]) | undefined;
}
+/**
+ * `DropdownButton` component.
+ *
+ * A styled dropdown button that optionally supports a tooltip.
+ *
+ * @param {React.ReactElement} overlay - The overlay shown when the button is
clicked.
+ * @param {string} [tooltip] - The tooltip text shown when the cursor hovers
over the button.
+ * @param {'topLeft'|'topRight'|'bottomLeft'|'bottomRight'} [placement] - The
placement of the tooltip.
+ * @param {((buttons: ReactNode[]) => ReactNode[]) | undefined}
[buttonsRender] - A function to customize the rendering of the buttons.
+ * @returns {JSX.Element} A styled dropdown button element.
+ */
export const DropdownButton = ({
overlay,
tooltip,
placement,
...rest
}: DropdownButtonProps) => {
+ /**
+ * `buildButton` function.
+ *
+ * Builds the button with optional custom button rendering.
+ *
+ * @param {Object} props - The properties for the button.
+ * @param {((buttons: ReactNode[]) => ReactNode[]) | undefined}
[props.buttonsRender] - A function to customize the rendering of the buttons.
+ * @returns {JSX.Element} A styled dropdown button element.
+ */
const buildButton = (
props: {
buttonsRender?: DropdownButtonProps['buttonsRender'];