-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e7fe7f5
commit b3f2dc5
Showing
8 changed files
with
60 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Markdown elements for react-markdown | ||
|
||
import { cn } from '@/lib/utils' | ||
|
||
interface Props { | ||
children?: React.ReactNode | ||
variant?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | ||
} | ||
export const H = ({ children, variant = 'h1' }: Props) => { | ||
const baseClass = 'font-semibold text-accent-foreground mt-3 mb-1' | ||
if (variant === 'h1') | ||
return <h1 className={cn(baseClass, 'text-xl')}>{children}</h1> | ||
if (variant === 'h2') | ||
return <h2 className={cn(baseClass, 'text-lg')}>{children}</h2> | ||
if (variant === 'h3') | ||
return <h3 className={cn(baseClass, 'text-xs uppercase')}>{children}</h3> | ||
} | ||
|
||
export const H2 = ({ children }: Props) => <H variant="h2">{children}</H> | ||
export const H3 = ({ children }: Props) => <H variant="h3">{children}</H> | ||
|
||
export const P = ({ children }: Props) => <p className="mb-1">{children}</p> | ||
|
||
export const Hr = () => <hr className="my-4" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters