mirror of
https://github.com/estruyf/vscode-front-matter.git
synced 2026-05-03 20:12:24 +02:00
25 lines
652 B
TypeScript
25 lines
652 B
TypeScript
import * as React from 'react';
|
|
|
|
export interface IQuickActionProps {
|
|
title: string;
|
|
onClick: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
}
|
|
|
|
export const QuickAction: React.FunctionComponent<IQuickActionProps> = ({
|
|
title,
|
|
onClick,
|
|
children
|
|
}: React.PropsWithChildren<IQuickActionProps>) => {
|
|
return (
|
|
<button
|
|
type="button"
|
|
title={title}
|
|
onClick={onClick}
|
|
className={`px-2 group inline-flex justify-center text-sm font-medium text-[var(--vscode-foreground)] hover:text-[var(--frontmatter-button-hoverBackground)]`}
|
|
>
|
|
{children}
|
|
<span className="sr-only">{title}</span>
|
|
</button>
|
|
);
|
|
};
|