@@ -3,7 +3,7 @@ import { FaJava, FaJs, FaPython, FaPhp } from "react-icons/fa";
33import { TbBrandCSharp } from "react-icons/tb" ;
44import { SiCplusplus , SiTypescript } from "react-icons/si" ;
55import { CodeBlock } from "react-code-block" ;
6- import type { TopicExample } from "@/types/Topic" ;
6+ import { Languages , type TopicExample } from "@/types/Topic" ;
77
88const ProgrammingLanguagesTabs = [
99 { lang : "JavaScript" , icon : < FaJs /> } ,
@@ -17,7 +17,10 @@ const ProgrammingLanguagesTabs = [
1717
1818const CodeExample = ( { examples } : { examples : TopicExample [ ] } ) => {
1919 return (
20- < Card . Root size = "sm" style = { { background : "#222222" } } >
20+ < Card . Root
21+ size = "sm"
22+ style = { { background : "#222222" , overflowX : "auto" , padding : "0 8px" } }
23+ >
2124 < Tabs . Root defaultValue = { examples [ 0 ] . language } variant = "plain" >
2225 < Tabs . List >
2326 { ProgrammingLanguagesTabs . filter ( ( tab ) => {
@@ -37,7 +40,10 @@ const CodeExample = ({ examples }: { examples: TopicExample[] }) => {
3740 { examples . map ( ( example ) => {
3841 return (
3942 < Tabs . Content value = { example . language } >
40- < CodeBlock code = { `${ example . code } ` } language = "python" >
43+ < CodeBlock
44+ code = { `${ example . code } ` }
45+ language = { Languages [ example . language ] }
46+ >
4147 < CodeBlock . Code style = { { padding : "16px" } } >
4248 < CodeBlock . LineContent >
4349 < CodeBlock . Token />
0 commit comments