mirror of
https://github.com/estruyf/vscode-front-matter.git
synced 2026-06-26 04:51:03 +02:00
26 lines
600 B
TypeScript
26 lines
600 B
TypeScript
import { XIcon } from '@heroicons/react/outline';
|
|
import * as React from 'react';
|
|
|
|
export interface IChoiceButtonProps {
|
|
title: string;
|
|
value: string;
|
|
onClick: (value: string) => void;
|
|
}
|
|
|
|
export const ChoiceButton: React.FunctionComponent<IChoiceButtonProps> = ({
|
|
title,
|
|
value,
|
|
onClick
|
|
}: React.PropsWithChildren<IChoiceButtonProps>) => {
|
|
return (
|
|
<button
|
|
title={`Remove ${title}`}
|
|
className="metadata_field__choice__button"
|
|
onClick={() => onClick(value)}
|
|
>
|
|
{title}
|
|
<XIcon className={`metadata_field__choice__button_icon`} />
|
|
</button>
|
|
);
|
|
};
|