From ed8ad48310019a3e7da5bad6fe2514e8145f2489 Mon Sep 17 00:00:00 2001 From: Francisco Pessano <76450203+FranP-code@users.noreply.github.com> Date: Sat, 12 Jul 2025 00:37:07 -0300 Subject: [PATCH] YouTube Video Classifier Platform --- web/src/components/SearchAndFilter.tsx | 129 ++++++++++++++ web/src/components/StatsOverview.tsx | 41 +++++ web/src/components/VideoClassifierApp.tsx | 195 ++++++++++++++++++++++ web/src/components/VirtualTable.tsx | 163 ++++++++++++++++++ web/src/components/ui/badge.tsx | 36 ++++ web/src/components/ui/input.tsx | 25 +++ web/src/components/ui/select.tsx | 23 +++ web/src/env.d.ts | 2 + web/src/pages/api/videos.ts | 51 ++++++ web/src/pages/index.astro | 33 ++-- web/src/types/video.ts | 22 +++ web/src/utils/csvParser.ts | 41 +++++ web/src/utils/search.ts | 57 +++++++ 13 files changed, 803 insertions(+), 15 deletions(-) create mode 100644 web/src/components/SearchAndFilter.tsx create mode 100644 web/src/components/StatsOverview.tsx create mode 100644 web/src/components/VideoClassifierApp.tsx create mode 100644 web/src/components/VirtualTable.tsx create mode 100644 web/src/components/ui/badge.tsx create mode 100644 web/src/components/ui/input.tsx create mode 100644 web/src/components/ui/select.tsx create mode 100644 web/src/env.d.ts create mode 100644 web/src/pages/api/videos.ts create mode 100644 web/src/types/video.ts create mode 100644 web/src/utils/csvParser.ts create mode 100644 web/src/utils/search.ts diff --git a/web/src/components/SearchAndFilter.tsx b/web/src/components/SearchAndFilter.tsx new file mode 100644 index 0000000..9f80e16 --- /dev/null +++ b/web/src/components/SearchAndFilter.tsx @@ -0,0 +1,129 @@ +import React from 'react'; +import { Input } from './ui/input'; +import { Select } from './ui/select'; +import { Button } from './ui/button'; +import { Badge } from './ui/badge'; +import type { VideoData } from '../types/video'; +import { getUniqueValues } from '../utils/search'; + +interface SearchAndFilterProps { + data: VideoData[]; + searchTerm: string; + onSearchChange: (term: string) => void; + filters: { + classification: string; + language: string; + playlist_name: string; + }; + onFilterChange: (filters: any) => void; + totalResults: number; + filteredResults: number; +} + +export function SearchAndFilter({ + data, + searchTerm, + onSearchChange, + filters, + onFilterChange, + totalResults, + filteredResults +}: SearchAndFilterProps) { + const classifications = getUniqueValues(data, 'classification'); + const languages = getUniqueValues(data, 'language'); + const playlists = getUniqueValues(data, 'playlist_name'); + + const clearFilters = () => { + onSearchChange(''); + onFilterChange({ + classification: 'all', + language: 'all', + playlist_name: 'all' + }); + }; + + const activeFiltersCount = Object.values(filters).filter(value => value !== 'all').length + (searchTerm ? 1 : 0); + + return ( +
+ {filteredResults} of {totalResults} videos
+ {activeFiltersCount > 0 && (
+
Loading video data...
++ {error} +
+To fix this:
+video_classifications.csv exists in your project root+ AI-powered video classification and management platform. Search, filter, and organize your YouTube video collection with intelligent categorization. +
++ Try adjusting your search terms or filters +
++ Your CSV file appears to be empty +
++ Powered by AI classification • {data.length} videos indexed +
+ +