Files
pterodactyl_addon/resources/scripts/addons/advanced-admin/console/DangerCommandWarning.tsx
2026-06-11 20:33:44 -05:00

29 lines
1.2 KiB
TypeScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* Danger Command Warning Modal
* Ball Studios <https://git.balls.studio>
*/
import React from 'react';
interface Suggestion { command: string; danger_reason?: string; }
interface Props { suggestion: Suggestion; onConfirm: () => void; onCancel: () => void; }
export default function DangerCommandWarning({ suggestion, onConfirm, onCancel }: Props) {
return (
<div className='addon-modal-overlay' role='dialog' aria-modal='true' aria-label='Danger warning'>
<div className='addon-modal addon-modal-danger'>
<div className='addon-modal-icon'></div>
<h3 className='addon-modal-title'>Potentially Dangerous Command</h3>
<p className='addon-modal-body'>
<code>/{suggestion.command}</code> may have destructive effects.
{suggestion.danger_reason && <><br />{suggestion.danger_reason}</>}
</p>
<div className='addon-modal-actions'>
<button className='addon-btn addon-btn-secondary' onClick={onCancel}>Cancel</button>
<button className='addon-btn addon-btn-danger' onClick={onConfirm}>Send Anyway</button>
</div>
</div>
</div>
);
}