import React from 'react'; import { Icon, Typography, Tooltip } from 'antd'; import styles from './index.less'; const firstUpperCase = (pathString: string) => { return pathString .replace('.', '') .split(/\/|\-/) .map(s => s.toLowerCase().replace(/( |^)[a-z]/g, L => L.toUpperCase())) .filter(s => s) .join(''); }; const BlockCodeView: React.SFC<{ url: string; }> = ({ url }) => { console.log(url); const blockUrl = `umi block add https://github.com/ant-design/pro-blocks/tree/master/${firstUpperCase( url, )} --npm-client=cnpm --path=${url}`; return (
{blockUrl}