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

24 lines
768 B
TypeScript

/**
* Syntax Helper — shows command signature below the input
* Ball Studios <https://git.balls.studio>
*/
import React from 'react';
interface Suggestion { syntax: string; examples: string[]; plugin: string; }
interface Props { suggestion: Suggestion; }
export default function SyntaxHelper({ suggestion }: Props) {
return (
<div className='addon-syntax-helper'>
<code className='addon-syntax'>{suggestion.syntax}</code>
{suggestion.examples.length > 0 && (
<span className='addon-syntax-example'>e.g. {suggestion.examples[0]}</span>
)}
{suggestion.plugin && (
<span className='addon-syntax-plugin'>[{suggestion.plugin}]</span>
)}
</div>
);
}