mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
re-structure to monorepo.
This commit is contained in:
31
packages/webapp/src/components/Forms/InputPrependButton.tsx
Normal file
31
packages/webapp/src/components/Forms/InputPrependButton.tsx
Normal file
@@ -0,0 +1,31 @@
|
||||
// @ts-nocheck
|
||||
import React, { useMemo } from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { Button, Tooltip, Classes } from '@blueprintjs/core';
|
||||
|
||||
export function InputPrependButton({
|
||||
buttonProps = {},
|
||||
tooltip = false,
|
||||
tooltipProps = {},
|
||||
}) {
|
||||
const appendButton = useMemo(
|
||||
() => (
|
||||
<Button
|
||||
className={classNames('input-prepend__button', Classes.SMALL)}
|
||||
{...buttonProps}
|
||||
/>
|
||||
),
|
||||
[buttonProps],
|
||||
);
|
||||
|
||||
const appendButtonWithTooltip = useMemo(
|
||||
() => <Tooltip {...tooltipProps}>{appendButton}</Tooltip>,
|
||||
[tooltipProps, appendButton],
|
||||
);
|
||||
|
||||
return (
|
||||
<div class="input-prepend">
|
||||
{tooltip ? appendButtonWithTooltip : appendButton}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user