-
-
-
- setSearchQuery(e.target.value)}
- placeholder={t('searchPlaceholder')}
- className="w-full pl-10 pr-10 py-3 border rounded-lg"
- />
-
- {searchQuery && (
-
- )}
-
-
-
- {categoryData.map(category => (
-
- {category.translations[localeKey] ??
+
+ {categoryData.map(category => {
+ const slug = category.slug as keyof typeof qaTabStyles;
+ const value = slug as CategorySlug;
+ return (
+
- ))}
+ value
+ }
+ style={qaTabStyles[slug]}
+ isActive={active === value}
+ />
+ );
+ })}
{categoryData.map(category => (
- {isLoading ? (
+ {isLoading && (
- ) : items.length ? (
-
- ) : (
-
- {debouncedSearch
- ? t('noResults', { query: debouncedSearch })
- : t('noQuestions')}
-
)}
+
+ {items.length ? (
+
+ ) : (
+
+ {t('noQuestions')}
+
+ )}
+
))}
@@ -88,6 +78,7 @@ export default function TabsSection() {
currentPage={currentPage}
totalPages={totalPages}
onPageChange={handlePageChange}
+ accentColor={qaTabStyles[active as keyof typeof qaTabStyles].accent}
/>
)}
diff --git a/frontend/components/q&a/QaTabButton.tsx b/frontend/components/q&a/QaTabButton.tsx
new file mode 100644
index 00000000..b183afd1
--- /dev/null
+++ b/frontend/components/q&a/QaTabButton.tsx
@@ -0,0 +1,55 @@
+'use client';
+
+import Image from 'next/image';
+
+import { TabsTrigger } from '@/components/ui/tabs';
+import { cn } from '@/lib/utils';
+import type { CategorySlug } from '@/components/q&a/types';
+import type { QaTabStyle } from '@/data/qaTabs';
+
+type QaTabButtonProps = {
+ value: CategorySlug;
+ label: string;
+ style: QaTabStyle;
+ isActive: boolean;
+};
+
+export function QaTabButton({
+ value,
+ label,
+ style,
+ isActive,
+}: QaTabButtonProps) {
+ return (
+