import { Button } from "./Button"; import { ToolTip } from "components/ToolTip"; import { cJoin } from "helpers/className"; import { ConditionalWrapper, Wrapper } from "helpers/component"; import { isDefinedAndNotEmpty } from "helpers/others"; /* * ╭─────────────╮ * ───────────────────────────────────────╯ COMPONENT ╰─────────────────────────────────────────── */ interface Props { className?: string; buttonsProps: (Parameters[0] & { tooltip?: string | null | undefined; })[]; } // ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ export const ButtonGroup = ({ buttonsProps, className, }: Props): JSX.Element => (
{buttonsProps.map((buttonProps, index) => (
); /* * ╭──────────────────────╮ * ───────────────────────────────────╯ PRIVATE COMPONENTS ╰────────────────────────────────────── */ interface ToolTipWrapperProps { text: string; } const ToolTipWrapper = ({ text, children }: ToolTipWrapperProps & Wrapper) => ( <>{children} );