import React, { FC } from 'react';
import { Box, Text } from 'ink';
import decamelize from 'decamelize';
import { ARGS, ARG } from '../config';
const Type: FC<{ type: any; enum?: string[] }> = ({ type, enum: e }) => {
if (type === Boolean) {
return (
<>
true
|
false
>
);
}
if (e?.length > 0) {
return (
<>
{e.map((item, i, { length: len }) => {
if (i !== len - 1) {
return (
{item}
|
);
}
return (
{item}
);
})}
>
);
}
return string;
};
const Command: FC<{ name: string; info: ARG }> = ({ name, info: { alias, description, type, enum: e } }) => {
return (
--{name}
{alias && -{alias}}
{description}
);
};
const Help: FC<{ context: any }> = ({ context: { templates } }) => {
return (
<>
{' astro '}
{' '}
help{' '}
{Object.entries(ARGS).map(([name, info]) => (
value) } : info} />
))}
>
);
};
export default Help;