Interface to the rescue?

This commit is contained in:
2024-06-30 23:37:43 +02:00
parent 35f6e7f21f
commit 32814269ef
+17 -1
View File
@@ -15,7 +15,23 @@ import {
DialogTrigger, DialogTrigger,
} from "@/components/ui/dialog" } from "@/components/ui/dialog"
const languages = ['en', 'fr', 'it', 'de', 'es', 'ja', 'no', 'sv', 'uk', 'ru']; type LanguageCode = 'en' | 'fr' | 'it' | 'de' | 'es' | 'ja' | 'no' | 'sv' | 'uk' | 'ru';
type AlgorithmKey = 'bubble' | 'insertion' | 'heap' | 'quick' | 'merge' | 'radix' | 'counting' | 'bucket' | 'shell';
interface AlgorithmDescription {
title: string;
timeComplexity: string;
spaceComplexity: string;
description: string;
}
type Translations = {
[key in AlgorithmKey]: {
[lang in LanguageCode]: AlgorithmDescription;
};
};
const languages: LanguageCode[] = ['en', 'fr', 'it', 'de', 'es', 'ja', 'no', 'sv', 'uk', 'ru'];
const translations = { const translations = {
bubble: { bubble: {