2022-01-12 00:53:23 +00:00
|
|
|
import classNames from "classnames";
|
2021-02-22 02:39:04 +00:00
|
|
|
import { Component } from "inferno";
|
2022-06-23 19:44:05 +00:00
|
|
|
import { i18n } from "../../i18next";
|
2021-02-11 20:35:27 +00:00
|
|
|
|
|
|
|
interface IconProps {
|
|
|
|
icon: string;
|
|
|
|
classes?: string;
|
2022-01-12 00:53:23 +00:00
|
|
|
inline?: boolean;
|
|
|
|
small?: boolean;
|
2021-02-11 20:35:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export class Icon extends Component<IconProps, any> {
|
|
|
|
constructor(props: any, context: any) {
|
|
|
|
super(props, context);
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
2022-01-12 00:53:23 +00:00
|
|
|
<svg
|
2022-09-22 15:03:35 +00:00
|
|
|
className={classNames("icon", this.props.classes, {
|
2022-01-12 00:53:23 +00:00
|
|
|
"icon-inline": this.props.inline,
|
|
|
|
small: this.props.small,
|
|
|
|
})}
|
|
|
|
>
|
2022-11-18 18:28:05 +00:00
|
|
|
<use
|
|
|
|
xlinkHref={`/static/assets/symbols.svg#icon-${this.props.icon}`}
|
|
|
|
></use>
|
2023-06-20 12:01:29 +00:00
|
|
|
<div className="visually-hidden">
|
2021-03-25 15:20:54 +00:00
|
|
|
<title>{this.props.icon}</title>
|
|
|
|
</div>
|
2021-02-11 20:35:27 +00:00
|
|
|
</svg>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-07-17 20:21:31 +00:00
|
|
|
interface SpinnerProps {
|
|
|
|
large?: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
export class Spinner extends Component<SpinnerProps, any> {
|
2021-02-11 20:35:27 +00:00
|
|
|
constructor(props: any, context: any) {
|
|
|
|
super(props, context);
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
2021-07-17 20:21:31 +00:00
|
|
|
return (
|
|
|
|
<Icon
|
|
|
|
icon="spinner"
|
|
|
|
classes={`spin ${this.props.large && "spinner-large"}`}
|
|
|
|
/>
|
|
|
|
);
|
2021-02-11 20:35:27 +00:00
|
|
|
}
|
|
|
|
}
|
2022-06-23 19:44:05 +00:00
|
|
|
|
|
|
|
export class PurgeWarning extends Component<any, any> {
|
|
|
|
constructor(props: any, context: any) {
|
|
|
|
super(props, context);
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
2023-06-20 18:46:16 +00:00
|
|
|
<div className="purge-warning mt-2 alert alert-danger" role="alert">
|
2023-06-20 12:01:29 +00:00
|
|
|
<Icon icon="alert-triangle" classes="icon-inline me-2" />
|
2022-06-23 19:44:05 +00:00
|
|
|
{i18n.t("purge_warning")}
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|