mirror of
https://github.com/captbaritone/webamp.git
synced 2026-01-24 02:36:00 +00:00
20 lines
459 B
JavaScript
20 lines
459 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;
|