-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
Showing
5 changed files
with
65 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { File } from './svgs/File.js' | ||
import { Terminal } from './svgs/Terminal.js' | ||
|
||
export function CodeTitle({ children, ...props }: { children: string }) { | ||
const language = 'data-language' in props ? props['data-language'] : undefined | ||
return ( | ||
<div {...props}> | ||
<div style={{ display: 'flex', alignItems: 'center', gap: 6 }}> | ||
{language === 'bash' ? ( | ||
<Terminal width={14} height={14} style={{ marginTop: 3 }} /> | ||
) : ( | ||
<File width={14} height={14} style={{ marginTop: 1 }} /> | ||
)} | ||
{children} | ||
</div> | ||
</div> | ||
) | ||
} |
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,14 @@ | ||
export function File(props: React.SVGProps<SVGSVGElement>) { | ||
return ( | ||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 94 99" fill="none" {...props}> | ||
<title>File</title> | ||
<rect width={77} height={89} x={8} y={3} stroke="currentColor" strokeWidth={6} rx={7} /> | ||
<path | ||
stroke="currentColor" | ||
strokeLinecap="round" | ||
strokeWidth={6} | ||
d="M25 22h43M25 35h43M25 48h22" | ||
/> | ||
</svg> | ||
) | ||
} |
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,12 @@ | ||
export function Terminal(props: React.SVGProps<SVGSVGElement>) { | ||
return ( | ||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 79 95" fill="none" {...props}> | ||
<title>Terminal</title> | ||
<path | ||
fill="currentColor" | ||
d="M38.281 34.033c0-1.074-.39-2.05-1.22-2.88L6.885 1.171C6.152.39 5.175 0 4.053 0 1.758 0 0 1.709 0 4.004c0 1.074.488 2.1 1.172 2.88l27.295 27.15L1.172 61.181C.488 61.962 0 62.939 0 64.062c0 2.295 1.758 4.004 4.053 4.004 1.123 0 2.1-.39 2.832-1.172l30.176-29.98c.83-.83 1.22-1.807 1.22-2.88Z" | ||
/> | ||
<path stroke="currentColor" strokeLinecap="round" strokeWidth={8} d="M36 75h55" /> | ||
</svg> | ||
) | ||
} |
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