Skip to content

Commit

Permalink
Create Language.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
Ibrahim-Halil-Kuray committed Oct 29, 2023
1 parent bbe10a7 commit 85e51f4
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions src/components/Language.tsx
@@ -0,0 +1,35 @@
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import React, { useState } from 'react';

interface LanguageProps {
onSelectLanguage: (selectedLanguage: string) => void;
}

const Language: React.FC<LanguageProps> = ({ onSelectLanguage }) => {
const languages = [
'Javascript',
'Python',
'PHP',
'React',
'Angular',
'Vue',
'Tailwind',
];

return (
<div>
<h2>Choose a programming language to test yourself please:</h2>
<ul>
{languages.map((language, index) => (
<li key={index}>
<button onClick={() => onSelectLanguage(language)}>
{language}
</button>
</li>
))}
</ul>
</div>
);
};

export default Language;

0 comments on commit 85e51f4

Please sign in to comment.