import React from 'react'; import { Button, IconButton, Tooltip, useBreakpoint, SpaceProps } from '@chakra-ui/react'; import { Plus } from 'phosphor-react'; import { useTranslation } from 'react-i18next'; export interface CreateButtonProps extends SpaceProps { onClick?: () => void; isDisabled?: boolean; isLoading?: boolean; isCompact?: boolean; label?: string; } const _CreateButton: React.FC = ({ onClick, isDisabled, isLoading, isCompact = true, label, ...props }) => { const { t } = useTranslation(); const breakpoint = useBreakpoint(); if (!isCompact && breakpoint !== 'base' && breakpoint !== 'sm') { return ( ); } return ( } isLoading={isLoading} isDisabled={isDisabled} {...props} /> ); }; export const CreateButton = React.memo(_CreateButton);