2021-10-02 16:46:46 +03:00
|
|
|
import React, { FunctionComponent } from 'react';
|
2021-10-07 21:08:21 +03:00
|
|
|
import globalize from '../../../scripts/globalize';
|
2021-10-02 16:46:46 +03:00
|
|
|
|
|
|
|
const createButtonElement = ({ className, title, icon }) => ({
|
|
|
|
__html: `<button
|
|
|
|
is="emby-button"
|
|
|
|
type="button"
|
|
|
|
class="${className}"
|
|
|
|
style="margin-left:1em;"
|
|
|
|
title="${title}">
|
|
|
|
<span class="material-icons ${icon}"></span>
|
|
|
|
</button>`
|
|
|
|
});
|
|
|
|
|
|
|
|
type IProps = {
|
|
|
|
title?: string;
|
|
|
|
className?: string;
|
|
|
|
icon?: string,
|
|
|
|
}
|
|
|
|
|
|
|
|
const SectionTitleButtonElement: FunctionComponent<IProps> = ({ className, title, icon }: IProps) => {
|
|
|
|
return (
|
|
|
|
<div
|
|
|
|
dangerouslySetInnerHTML={createButtonElement({
|
|
|
|
className: className,
|
|
|
|
title: globalize.translate(title),
|
|
|
|
icon: icon
|
|
|
|
})}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default SectionTitleButtonElement;
|