2024-02-01 00:58:19 +03:00
|
|
|
'use client';
|
|
|
|
|
|
|
|
import { forwardRef } from 'react';
|
2024-02-01 15:23:59 +03:00
|
|
|
import { Icon } from '../components';
|
|
|
|
import { ButtonProps } from './button.types';
|
2024-02-01 00:58:19 +03:00
|
|
|
import { ButtonLayout } from '../button-layout/button-layout';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Button component
|
|
|
|
** description
|
|
|
|
*/
|
|
|
|
|
2024-02-01 15:23:59 +03:00
|
|
|
export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
2024-02-01 00:58:19 +03:00
|
|
|
(
|
|
|
|
{ centralRipple = false, variant, disabled = false, icon, ...props },
|
|
|
|
ref,
|
|
|
|
) => (
|
|
|
|
<ButtonLayout
|
|
|
|
{...props}
|
|
|
|
centralRipple={centralRipple}
|
|
|
|
disabled={disabled}
|
|
|
|
ref={ref}
|
|
|
|
variant={variant ? variant : 'filled'}
|
|
|
|
>
|
|
|
|
{icon ? <Icon iconSize={20}>{icon}</Icon> : <></>}
|
|
|
|
<span className={'label-large'}>{props.children}</span>
|
|
|
|
</ButtonLayout>
|
|
|
|
),
|
|
|
|
);
|