diff --git a/src/assets/icons/languages/json.svg b/src/assets/icons/languages/json.svg new file mode 100644 index 00000000..77333f54 --- /dev/null +++ b/src/assets/icons/languages/json.svg @@ -0,0 +1,2 @@ + +JSON icon \ No newline at end of file diff --git a/src/components/CodePlayground/index.stories.tsx b/src/components/CodePlayground/index.stories.tsx index ab8edea1..88adb344 100644 --- a/src/components/CodePlayground/index.stories.tsx +++ b/src/components/CodePlayground/index.stories.tsx @@ -46,6 +46,16 @@ puts users`, const users = sdk.getUsers() console.log(users)`, }, + json: { + code: `{ + "users": [ + { + "id": 1, + "name": "John Doe" + }, + ] +}`, + }, } export const Default: Story = { diff --git a/src/components/TargetLanguageIcon/index.tsx b/src/components/TargetLanguageIcon/index.tsx index cc04ba62..db4613de 100644 --- a/src/components/TargetLanguageIcon/index.tsx +++ b/src/components/TargetLanguageIcon/index.tsx @@ -12,6 +12,7 @@ import PhpIcon from '@/assets/icons/languages/php.svg?react' import SwiftIcon from '@/assets/icons/languages/swift.svg?react' import RubyIcon from '@/assets/icons/languages/ruby.svg?react' import PostmanIcon from '@/assets/icons/languages/postman.svg?react' +import JSONIcon from '@/assets/icons/languages/json.svg?react' import { cn } from '@/lib/utils' const sizeMap: Record = { @@ -45,6 +46,7 @@ const icons: Record< swift: SwiftIcon, ruby: RubyIcon, postman: PostmanIcon, + json: JSONIcon, } export interface TargetLanguageIconProps { diff --git a/src/types.ts b/src/types.ts index 223037b3..171280c4 100644 --- a/src/types.ts +++ b/src/types.ts @@ -87,6 +87,7 @@ export const supportedLanguages = [ 'swift', 'ruby', 'postman', + 'json', ] as const export type SupportedLanguage = (typeof supportedLanguages)[number] @@ -121,6 +122,8 @@ export function prettyLanguageName(language: SupportedLanguage) { return 'Terraform' case 'unity': return 'Unity' + case 'json': + return 'JSON' default: assertNever(language) }