2021-10-02 18:10:14 +03:00
|
|
|
import React, { FunctionComponent } from 'react';
|
2021-10-19 19:19:28 +03:00
|
|
|
import globalize from '../../../scripts/globalize';
|
2021-10-02 18:10:14 +03:00
|
|
|
|
|
|
|
const createButtonElement = ({ type, className, title }) => ({
|
|
|
|
__html: `<button
|
|
|
|
is="emby-button"
|
|
|
|
type="${type}"
|
|
|
|
class="${className}"
|
|
|
|
>
|
|
|
|
<span>${title}</span>
|
|
|
|
</button>`
|
|
|
|
});
|
|
|
|
|
|
|
|
type IProps = {
|
|
|
|
type?: string;
|
|
|
|
className?: string;
|
|
|
|
title?: string
|
|
|
|
}
|
|
|
|
|
|
|
|
const ButtonElement: FunctionComponent<IProps> = ({ type, className, title }: IProps) => {
|
|
|
|
return (
|
|
|
|
<div
|
|
|
|
dangerouslySetInnerHTML={createButtonElement({
|
|
|
|
type: type,
|
|
|
|
className: className,
|
|
|
|
title: globalize.translate(title)
|
|
|
|
})}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default ButtonElement;
|