mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-23 01:57:29 +00:00
16 lines
440 B
JavaScript
16 lines
440 B
JavaScript
import React from "react";
|
|
import PropTypes from "prop-types";
|
|
|
|
export const characterClassName = char =>
|
|
`character-${char.toString().toLowerCase().charCodeAt(0)}`;
|
|
|
|
const Character = ({ children: char, id }) =>
|
|
<div id={id} className={`character ${characterClassName(char)}`}>
|
|
{char}
|
|
</div>;
|
|
|
|
Character.propTypes = {
|
|
children: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired
|
|
};
|
|
|
|
export default Character;
|