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