import classNames from 'classnames'; import React from 'react'; export interface InputHelpItem { label?: string | null; examples?: string[] | null; } interface Props { items: InputHelpItem[]; show?: boolean; onChange?: (value: string) => void; } /** * Interactive help menu to display below `MaterialsInput` */ export const InputHelp: React.FC = (props) => { return (
{props.items.map((item, i) => (
{item.examples && (
{item.label && {item.label}:}
{item.examples.map((example, k) => ( { if (props.onChange) props.onChange(example); }} > {example} ))}
)} {!item.examples && item.label &&
{item.label}
}
))}
); };