mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralgw-ui.git
synced 2025-10-30 18:27:53 +00:00
29 lines
728 B
TypeScript
29 lines
728 B
TypeScript
import React from 'react';
|
|
import { IconButton, SpaceProps } from '@chakra-ui/react';
|
|
import { X } from '@phosphor-icons/react';
|
|
import { useTranslation } from 'react-i18next';
|
|
|
|
export interface CloseButtonProps extends SpaceProps {
|
|
onClick: () => void;
|
|
isDisabled?: boolean;
|
|
isLoading?: boolean;
|
|
}
|
|
|
|
const _CloseButton: React.FC<CloseButtonProps> = ({ onClick, isDisabled, isLoading, ...props }) => {
|
|
const { t } = useTranslation();
|
|
|
|
return (
|
|
<IconButton
|
|
aria-label={t('common.close')}
|
|
colorScheme="gray"
|
|
onClick={onClick}
|
|
icon={<X size={20} />}
|
|
isLoading={isLoading}
|
|
isDisabled={isDisabled}
|
|
{...props}
|
|
/>
|
|
);
|
|
};
|
|
|
|
export const CloseButton = React.memo(_CloseButton);
|