mirror of
https://github.com/wassname/talk.git
synced 2026-07-23 13:10:20 +08:00
13 lines
228 B
JavaScript
13 lines
228 B
JavaScript
import React from 'react';
|
|
import {matchLinks} from '../utils';
|
|
|
|
export default ({text, children}) => {
|
|
const hasLinks = !!matchLinks(text);
|
|
|
|
if (!hasLinks) {
|
|
return null;
|
|
}
|
|
|
|
return React.Children.only(children);
|
|
};
|