mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-08 04:27:15 +03:00
47 lines
1.3 KiB
TypeScript
47 lines
1.3 KiB
TypeScript
import * as React from "react";
|
|
|
|
export interface NoticeTextSelectionProps {
|
|
icon?: string,
|
|
text: string,
|
|
idSuffix: string,
|
|
onClick?: (event: React.MouseEvent) => unknown
|
|
}
|
|
|
|
export interface NoticeTextSelectionState {
|
|
|
|
}
|
|
|
|
class NoticeTextSelectionComponent extends React.Component<NoticeTextSelectionProps, NoticeTextSelectionState> {
|
|
|
|
constructor(props: NoticeTextSelectionProps) {
|
|
super(props);
|
|
}
|
|
|
|
render(): React.ReactElement {
|
|
const style: React.CSSProperties = {};
|
|
if (this.props.onClick) {
|
|
style.cursor = "pointer";
|
|
style.textDecoration = "underline"
|
|
}
|
|
|
|
return (
|
|
<tr id={"sponsorTimesInfoMessage" + this.props.idSuffix}
|
|
onClick={this.props.onClick}
|
|
style={style}
|
|
className="sponsorTimesInfoMessage">
|
|
|
|
<td>
|
|
{this.props.icon ?
|
|
<img src={chrome.runtime.getURL(this.props.icon)} className="sponsorTimesInfoIcon" />
|
|
: null}
|
|
|
|
<span>
|
|
{this.props.text}
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
);
|
|
}
|
|
}
|
|
|
|
export default NoticeTextSelectionComponent; |