MCPcopy Create free account
hub / github.com/alibaba/open-code-review / CodeBlock

Function CodeBlock

pages/src/components/QuickStartSection.tsx:43–68  ·  view source on GitHub ↗
({ label, code, multiline, onCopy })

Source from the content-addressed store, hash-verified

41 );
42
43const CodeBlock: React.FC<{ label: string; code: string; multiline?: boolean; onCopy: (text: string) => void }> = ({ label, code, multiline, onCopy }) => (
44 <div style={{ display: 'flex', flexDirection: 'column' }}>
45 <p style={{ color: 'rgba(255,255,255,0.5)', fontSize: 12, margin: '0 0 6px 0' }}>{label}</p>
46 <div
47 style={{
48 display: 'flex',
49 justifyContent: 'space-between',
50 alignItems: multiline ? 'flex-start' : 'center',
51 background: '#000000',
52 borderRadius: 6,
53 padding: '4px 16px',
54 border: '1px solid rgba(255,255,255,0.16)',
55 }}
56 >
57 <pre style={{ color: 'rgba(255,255,255,0.8)', fontSize: 13, fontFamily: 'Menlo, monospace', margin: 0, whiteSpace: 'pre-wrap', lineHeight: '22px' }}>
58 {code}
59 </pre>
60 <div
61 onClick={() => onCopy(code)}
62 style={{ paddingTop: 4, paddingBottom: 4, cursor: 'pointer', flexShrink: 0 }}
63 >
64 <img src={copyIcon} alt="copy" style={{ width: 16, height: 16 }} />
65 </div>
66 </div>
67 </div>
68);
69
70const QuickStartSection: React.FC = () => {
71 const { t } = useTranslation();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected