]> Untitled Git - lemmy-ui.git/blob - src/shared/components/icon.tsx
Running newer prettier.
[lemmy-ui.git] / src / shared / components / icon.tsx
1 import { Component } from "inferno";
2
3 interface IconProps {
4   icon: string;
5   classes?: string;
6 }
7
8 export class Icon extends Component<IconProps, any> {
9   constructor(props: any, context: any) {
10     super(props, context);
11   }
12
13   render() {
14     return (
15       <svg class={`icon ${this.props.classes}`}>
16         <title>{this.props.icon}</title>
17         <use xlinkHref={`#icon-${this.props.icon}`}></use>
18       </svg>
19     );
20   }
21 }
22
23 export class Spinner extends Component<any, any> {
24   constructor(props: any, context: any) {
25     super(props, context);
26   }
27
28   render() {
29     return <Icon icon="spinner" classes="icon-spinner spin" />;
30   }
31 }