mirror of
https://github.com/jaronpate/unicord.git
synced 2026-10-18 21:47:40 +00:00
refactor: Create shared components and global styles for improved code organization
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
import styles from './Feature.module.css';
|
||||
import { CodeExample } from './CodeExample';
|
||||
|
||||
type FeatureProps = {
|
||||
title: string;
|
||||
description: React.ReactNode;
|
||||
code?: string;
|
||||
codeHeight?: number;
|
||||
reversed?: boolean;
|
||||
};
|
||||
|
||||
export function Feature({ title, description, code, codeHeight, reversed = false }: FeatureProps) {
|
||||
const content = (
|
||||
<>
|
||||
<div className={styles.text}>
|
||||
<h2>{title}</h2>
|
||||
<div className={styles.description}>{description}</div>
|
||||
</div>
|
||||
{code && (
|
||||
<div className={styles.code}>
|
||||
<CodeExample code={code} height={codeHeight} noScroll={true} />
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
|
||||
return (
|
||||
<div className={`${styles.feature} ${reversed ? styles.reversed : ''}`}>
|
||||
{content}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user