Skip to content

Commit

Permalink
add languages
Browse files Browse the repository at this point in the history
  • Loading branch information
mckaywrigley committed Mar 31, 2023
1 parent 0cbbfb5 commit 31d7fa2
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 8 deletions.
55 changes: 49 additions & 6 deletions components/LanguageSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,55 @@ export const LanguageSelect: FC<Props> = ({ language, onChange }) => {
value={language}
onChange={handleChange}
>
<option value="javascript">JavaScript</option>
<option value="typescript">TypeScript</option>
<option value="python">Python</option>
<option value="tsx">TSX</option>
<option value="jsx">JSX</option>
<option value="go">Go</option>
{languages
.sort((a, b) => a.label.localeCompare(b.label))
.map((language) => (
<option key={language.value} value={language.value}>
{language.label}
</option>
))}
</select>
);
};

const languages = [
{ value: 'JavaScript', label: 'JavaScript' },
{ value: 'TypeScript', label: 'TypeScript' },
{ value: 'Python', label: 'Python' },
{ value: 'TSX', label: 'TSX' },
{ value: 'JSX', label: 'JSX' },
{ value: 'Go', label: 'Go' },
{ value: 'C', label: 'C' },
{ value: 'C++', label: 'C++' },
{ value: 'Java', label: 'Java' },
{ value: 'C#', label: 'C#' },
{ value: ' Visual Basic .NET', label: ' Visual Basic .NET' },
{ value: 'SQL', label: 'SQL' },
{ value: 'Assembly Language', label: 'Assembly Language' },
{ value: 'PHP', label: 'PHP' },
{ value: 'Ruby', label: 'Ruby' },
{ value: 'Swift', label: 'Swift' },
{ value: 'Kotlin', label: 'Kotlin' },
{ value: 'R', label: 'R' },
{ value: 'Objective-C', label: 'Objective-C' },
{ value: 'Perl', label: 'Perl' },
{ value: 'Scala', label: 'Scala' },
{ value: 'Dart', label: 'Dart' },
{ value: 'Rust', label: 'Rust' },
{ value: 'Haskell', label: 'Haskell' },
{ value: 'Lua', label: 'Lua' },
{ value: 'Groovy', label: 'Groovy' },
{ value: 'Elixir', label: 'Elixir' },
{ value: 'Clojure', label: 'Clojure' },
{ value: 'Lisp', label: 'Lisp' },
{ value: 'Julia', label: 'Julia' },
{ value: 'Matlab', label: 'Matlab' },
{ value: 'Fortran', label: 'Fortran' },
{ value: 'COBOL', label: 'COBOL' },
{ value: 'Bash', label: 'Bash' },
{ value: 'Powershell', label: 'Powershell' },
{ value: 'PL/SQL', label: 'PL/SQL' },
{ value: 'CSS', label: 'Racket' },
{ value: 'HTML', label: 'HTML' },
{ value: 'NoSQL', label: 'NoSQL' },
];
4 changes: 2 additions & 2 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import Head from 'next/head';
import { useEffect, useState } from 'react';

export default function Home() {
const [inputLanguage, setInputLanguage] = useState<string>('javascript');
const [outputLanguage, setOutputLanguage] = useState<string>('python');
const [inputLanguage, setInputLanguage] = useState<string>('JavaScript');
const [outputLanguage, setOutputLanguage] = useState<string>('Python');
const [inputCode, setInputCode] = useState<string>('');
const [outputCode, setOutputCode] = useState<string>('');
const [model, setModel] = useState<OpenAIModel>('gpt-3.5-turbo');
Expand Down

1 comment on commit 31d7fa2

@vercel
Copy link

@vercel vercel bot commented on 31d7fa2 Mar 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.