mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-09-29 22:34:33 +00:00
36 lines
749 B
TypeScript
36 lines
749 B
TypeScript
import type {ButtonProps} from 'sentry/components/button';
|
|
import Confirm from 'sentry/components/confirm';
|
|
|
|
import Anchor from './anchor';
|
|
|
|
type Props = {
|
|
message: React.ReactNode;
|
|
onConfirm: () => void;
|
|
title: string;
|
|
children?: React.ReactNode;
|
|
className?: string;
|
|
disabled?: boolean;
|
|
priority?: ButtonProps['priority'];
|
|
};
|
|
|
|
/**
|
|
* <Confirm> is a more generic version of this component
|
|
*/
|
|
function LinkWithConfirmation({
|
|
className,
|
|
disabled,
|
|
title,
|
|
children,
|
|
...otherProps
|
|
}: Props) {
|
|
return (
|
|
<Confirm {...otherProps} disabled={disabled}>
|
|
<Anchor href="#" className={className} disabled={disabled} title={title}>
|
|
{children}
|
|
</Anchor>
|
|
</Confirm>
|
|
);
|
|
}
|
|
|
|
export default LinkWithConfirmation;
|