mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-22 17:47:16 +00:00
19 lines
438 B
JavaScript
19 lines
438 B
JavaScript
import React from "react";
|
|
|
|
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: React.PropTypes.oneOfType([
|
|
React.PropTypes.string,
|
|
React.PropTypes.number
|
|
]).isRequired
|
|
};
|
|
|
|
export default Character;
|