import * as React from 'react'

interface OcticonProps {
  width?: number,
  height?: number,
  symbol: string
}

export default class Octicon extends React.Component<OcticonProps, void> {

  public static defaultProps: OcticonProps = { width: 16, height: 16, symbol: "" };

  public constructor(props: OcticonProps) {
    super(props)
  }

  public render() {
    return (
      <svg aria-hidden="true" class="octicon" width="12" height="16" role="img" version="1.1" viewBox="0 0 12 16">
        <path d="M12 9H7v5H5V9H0V7h5V2h2v5h5v2z"></path>
      </svg>
    )
  }
}

import * as React from 'react'
import {OcticonSymbol} from './octicons.generated'

export {OcticonSymbol as OcticonSymbol};

interface OcticonProps {
  width?: number,
  height?: number,
  symbol: OcticonSymbol
}

export class Octicon extends React.Component<OcticonProps, void> {

  public static defaultProps: OcticonProps = { width: 16, height: 16, symbol: OcticonSymbol.mark_github };

  public constructor(props: OcticonProps) {
    super(props)
  }

  public render() {
    const symbol = this.props.symbol;
    const viewBox = `0 0 ${symbol.w} ${symbol.h}`
    return (
      <svg aria-hidden="true" className="octicon" width={this.props.width} height={this.props.height} role="img" version="1.1" viewBox={viewBox}>
        <path d={symbol.d}></path>
      </svg>
    )
  }
}

Use the new OcticonSymbol type for the component
Use the new OcticonSymbol type for the component
