mirror of
https://github.com/estruyf/vscode-front-matter.git
synced 2026-05-18 15:25:43 +02:00
26 lines
640 B
TypeScript
26 lines
640 B
TypeScript
import * as React from 'react';
|
|
import { CheckIcon } from './Icons/CheckIcon';
|
|
import { WarningIcon } from './Icons/WarningIcon';
|
|
|
|
export interface IValidInfoProps {
|
|
label?: string;
|
|
isValid: boolean;
|
|
}
|
|
|
|
const ValidInfo: React.FunctionComponent<IValidInfoProps> = ({label, isValid}: React.PropsWithChildren<IValidInfoProps>) => {
|
|
return (
|
|
<>
|
|
{
|
|
isValid ? (
|
|
<span className="valid"><CheckIcon /></span>
|
|
) : (
|
|
<span className="warning"><WarningIcon /></span>
|
|
)
|
|
}
|
|
{ label && <span>{label}</span> }
|
|
</>
|
|
);
|
|
};
|
|
|
|
ValidInfo.displayName = 'ValidInfo';
|
|
export { ValidInfo }; |