
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@n3/react-remove-button
Advanced tools
Кнопка удаления для приложений на базе @n3/kit.
import {
RemoveButton,
} from '@n3/react-remove-button';
| Название | Обязательность | Тип | Значение по умолчанию | Описание |
|---|---|---|---|---|
| color | enum - buttonColors.DEFAULT - buttonColors.PRIMARY - buttonColors.TERTIARY - buttonColors.DANGER | undefined | Цвет кнопки | |
| size | enum - buttonSizes.DEFAULT - buttonSizes.SMALL | undefined | Размер кнопки | |
| disabled | bool | false | Выключена ли кнопка | |
| children | + | node | ||
| remove | + | func | Асинхронная функция удаления | |
| onRemoveSuccess | func | undefined | Обработчик успешного удаления | |
| approveTitle | node | undefined | Заголовок подтверждения | |
| approveContent | node | undefined | Текст подтверждения | |
| approveButtonText | + | string | Текст кнопки подтвеждения | |
| approveButtonColor | enum - buttonColors.DEFAULT - buttonColors.PRIMARY - buttonColors.TERTIARY - buttonColors.DANGER | buttonColors.DANGER | Цвет кнопки подтверждения | |
| cancelButtonText | + | string | Текст кнопки отмены | |
| errorsPath | string | 'response.data.detail' | Путь до объекта ошибкок в случае ошибки удаления | |
| redirectTo | any | undefined | Адрес редиректа в случае успешного удаления | |
| notification | object | undefined | Сообщение @n3/browser-messages в случае успешного удаления |
import type {
FC,
ReactNode,
} from 'react';
import {
useRemoveButton,
} from '@n3/react-remove-button';
import type {
UseRemoveButtonParams,
} from '@n3/react-remove-button';
type CustomRemoveButtonProps = UseRemoveButtonParams & {
children?: ReactNode;
};
const CustomRemoveButton: FC<CustomRemoveButtonProps> = (props) => {
const {
children,
remove,
onRemoveSuccess,
approveTitle,
approveContent,
approveButtonText,
approveButtonColor,
cancelButtonText,
errorsPath,
redirectTo,
notification,
} = props;
const {
isRemoving,
onClick,
} = useRemoveButton({
remove,
onRemoveSuccess,
approveTitle,
approveContent,
approveButtonText,
approveButtonColor,
cancelButtonText,
errorsPath,
redirectTo,
notification,
});
return (
<button
type="button"
disabled={isRemoving}
onClick={onClick}
>
{children}
</button>
);
};
FAQs
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.