jellyfish-web/src/components/DashboardComponent/users/ElementComponent/SectionTitleLinkElement.tsx
2021-10-19 19:15:24 +03:00

34 lines
820 B
TypeScript

import React, { FunctionComponent } from 'react';
import globalize from '../../../../scripts/globalize';
const createLinkElement = ({ className, title, href }) => ({
__html: `<a
is="emby-linkbutton"
rel="noopener noreferrer"
class="${className}"
target="_blank"
href="${href}"
>
${title}
</a>`
});
type IProps = {
title?: string;
className?: string;
url?: string
}
const SectionTitleLinkElement: FunctionComponent<IProps> = ({ className, title, url }: IProps) => {
return (
<div
dangerouslySetInnerHTML={createLinkElement({
className: className,
title: globalize.translate(title),
href: url
})}
/>
);
};
export default SectionTitleLinkElement;