mirror of
https://github.com/captbaritone/webamp.git
synced 2026-01-23 18:25:30 +00:00
21 lines
477 B
JavaScript
21 lines
477 B
JavaScript
import React from "react";
|
|
import PropTypes from "prop-types";
|
|
import Character from "./Character";
|
|
|
|
const CharacterString = props => {
|
|
const text = `${props.children}` || "";
|
|
const chars = text.split("");
|
|
return (
|
|
<div {...props}>
|
|
{chars.map((character, index) => (
|
|
<Character key={index + character}>{character}</Character>
|
|
))};
|
|
</div>
|
|
);
|
|
};
|
|
|
|
CharacterString.propsTypes = {
|
|
children: PropTypes.string
|
|
};
|
|
|
|
export default CharacterString;
|