TryGhost/Ghost

View on GitHub
ghost/admin/app/components/gh-post-settings-menu/ctrl-or-symbol.js

Summary

Maintainability
A
1 hr
Test Coverage
import Component from '@glimmer/component';
import {htmlSafe} from '@ember/template';

const isMac = window.navigator.platform.startsWith('Mac');

export default class CtrlOrCmd extends Component {
    get tooltip() {
        return isMac ? 'Control' : '';
    }

    get character() {
        const character = isMac ? '⌃' : 'Ctrl';
        return htmlSafe(character);
    }

    get class() {
        return isMac ? '' : 'mono';
    }
}