compassIcon.tsx
TLDR
This file contains a functional component called CompassIcon
that renders an <i>
element with a className based on the provided icon
and className
props.
Methods
There are no methods in this file.
Classes
There are no classes in this file.
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React from 'react'
type Props = {
icon: string
className?: string
}
export default function CompassIcon(props: Props): JSX.Element {
// All compass icon classes start with icon,
// so not expecting that prefix in props.
return (
<i className={`CompassIcon icon-${props.icon}${props.className === undefined ? '' : ` ${props.className}`}`}/>
)
}