diff --git a/src/components/SlugInput.astro b/src/components/SlugInput.astro index 43079a1..06ba25c 100644 --- a/src/components/SlugInput.astro +++ b/src/components/SlugInput.astro @@ -1,25 +1,17 @@ --- -import { getFeedMapping } from '../lib/db'; +import { getFeedMapping } from "../lib/db"; interface Props { currentSlugs?: string[]; } const { currentSlugs = [] } = Astro.props; -import { availableLanguages, languageMap } from '../lib/api'; +import { availableLanguages, languageMap } from "../lib/api"; -const languages = [ - { value: 'en', label: 'English' }, - { value: 'ja', label: 'Japanese' }, - { value: 'ko', label: 'Korean' }, - { value: 'zh', label: 'Chinese' }, - { value: 'fr', label: 'French' }, - { value: 'es', label: 'Spanish' }, - { value: 'it', label: 'Italian' }, - { value: 'de', label: 'German' }, - { value: 'tr', label: 'Turkish' }, - { value: 'pl', label: 'Polish' }, -]; +const languages = Object.entries(languageMap).map(([value, label]) => ({ + value, + label, +})); ---
@@ -37,9 +29,11 @@ const languages = [ id="lang-select" class="px-3 sm:px-4 py-2 bg-primary rounded-lg border border-hover/30 focus:outline-none focus:border-accent/50 transition-colors text-sm sm:text-base" > - {languages.map(lang => ( - - ))} + { + languages.map((lang) => ( + + )) + }
@@ -54,8 +48,16 @@ const languages = [ id="import-feed" class="px-4 py-2 bg-secondary hover:bg-hover transition-colors rounded-lg text-sm sm:text-base flex items-center gap-2" > - - + + Import Feed @@ -73,27 +75,46 @@ const languages = [ class="px-3 py-1.5 text-sm text-red-500 hover:text-red-600 hover:bg-red-500/10 rounded-lg transition-colors flex items-center gap-2" style="display: none;" > - - + + Clear All
- {currentSlugs.map(slug => ( -
- {slug} - -
- ))} + {slug} + +
+ )) + }
@@ -123,20 +144,26 @@ const languages = [
\ No newline at end of file +