189- **Imports:** Use `https://esm.sh` for npm and Deno dependencies to ensure compatibility on server and browser
190- **Storage Strategy:** Only use backend storage if explicitly required; prefer simple static client-side sites
191- **React Configuration:** When using React libraries, pin versions with `?deps=react@18.2.0,react-dom@18.2.0` and start the file with `/** @jsxImportSource https://esm.sh/react@18.2.0 */`
192- Ensure all React dependencies and sub-dependencies are pinned to the same version
193- **Styling:** Default to using TailwindCSS via `<script src="https://cdn.twind.style" crossorigin></script>` unless otherwise specified
194
275 - Always run table creation before querying
276
2773. **React Configuration:**
278 - All React dependencies must be pinned to 18.2.0
279 - Always include `@jsxImportSource https://esm.sh/react@18.2.0` at the top of React files
280 - Rendering issues often come from mismatched React versions
281
2824. **File Handling:**
103 </label>
104 <input type="text" id="customSubNiche" name="customSubNiche"
105 placeholder="e.g., React tutorials, Vegan recipes, Home workouts..."
106 class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
107 </div>
341 gaming: ['Game Reviews', 'Let\'s Play', 'Gaming News', 'Esports', 'Game Development', 'Mobile Gaming', 'Retro Gaming', 'Gaming Hardware'],
342 education: ['Online Courses', 'Language Learning', 'Math Tutorials', 'Science Experiments', 'History Lessons', 'Study Tips', 'Test Preparation', 'Educational Kids Content'],
343 entertainment: ['Movie Reviews', 'Comedy Skits', 'Reaction Videos', 'Celebrity News', 'TV Show Recaps', 'Stand-up Comedy', 'Viral Challenges', 'Pop Culture'],
344 lifestyle: ['Home Decor', 'Organization Tips', 'Minimalism', 'Self Improvement', 'Productivity', 'Morning Routines', 'Life Hacks', 'Personal Development'],
345 fitness: ['Workout Routines', 'Nutrition Tips', 'Weight Loss', 'Yoga', 'Bodybuilding', 'Running', 'Mental Health', 'Healthy Recipes'],
3 */
4
5import { useEffect, useRef } from "https://esm.sh/react@18.2.0?deps=react@18.2.0";
6import { updateViewingStatus } from "../services/viewingService.ts";
7
1# Frontend Hooks
2
3This directory contains custom React hooks that encapsulate stateful logic and side effects.
4
5## Files
1/** @jsxImportSource https://esm.sh/react */
2import { renderToString } from "npm:react-dom/server";
3import { sqlite } from "https://esm.town/v/std/sqlite";
4
108 </label>
109 <input type="text" id="customSubNiche" name="customSubNiche"
110 placeholder="e.g., React tutorials, Vegan recipes..."
111 class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-purple-500">
112 </div>
268 gaming: ['Game Reviews', 'Let\'s Play', 'Gaming News', 'Esports', 'Game Development', 'Mobile Gaming', 'Retro Gaming', 'Gaming Hardware'],
269 education: ['Online Courses', 'Language Learning', 'Math Tutorials', 'Science Experiments', 'History Lessons', 'Study Tips', 'Test Preparation', 'Educational Kids Content'],
270 entertainment: ['Movie Reviews', 'Comedy Skits', 'Reaction Videos', 'Celebrity News', 'TV Show Recaps', 'Stand-up Comedy', 'Viral Challenges', 'Pop Culture'],
271 lifestyle: ['Home Decor', 'Organization Tips', 'Minimalism', 'Self Improvement', 'Productivity', 'Morning Routines', 'Life Hacks', 'Personal Development'],
272 fitness: ['Workout Routines', 'Nutrition Tips', 'Weight Loss', 'Yoga', 'Bodybuilding', 'Running', 'Mental Health', 'Healthy Recipes'],
85 </label>
86 <input type="text" id="customSubNiche" name="customSubNiche"
87 placeholder="e.g., React tutorials, Vegan recipes..."
88 class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
89 </div>
173 gaming: ['Game Reviews', 'Let\'s Play', 'Gaming News', 'Esports', 'Game Development', 'Mobile Gaming', 'Retro Gaming', 'Gaming Hardware'],
174 education: ['Online Courses', 'Language Learning', 'Math Tutorials', 'Science Experiments', 'History Lessons', 'Study Tips', 'Test Preparation', 'Educational Kids Content'],
175 entertainment: ['Movie Reviews', 'Comedy Skits', 'Reaction Videos', 'Celebrity News', 'TV Show Recaps', 'Stand-up Comedy', 'Viral Challenges', 'Pop Culture'],
176 lifestyle: ['Home Decor', 'Organization Tips', 'Minimalism', 'Self Improvement', 'Productivity', 'Morning Routines', 'Life Hacks', 'Personal Development'],
177 fitness: ['Workout Routines', 'Nutrition Tips', 'Weight Loss', 'Yoga', 'Bodybuilding', 'Running', 'Mental Health', 'Healthy Recipes'],
81 </label>
82 <input type="text" id="customSubNiche" name="customSubNiche"
83 placeholder="e.g., React tutorials, Vegan recipes..."
84 class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
85 </div>
275 gaming: ['Game Reviews', 'Let\'s Play', 'Gaming News', 'Esports', 'Game Development', 'Mobile Gaming', 'Retro Gaming', 'Gaming Hardware'],
276 education: ['Online Courses', 'Language Learning', 'Math Tutorials', 'Science Experiments', 'History Lessons', 'Study Tips', 'Test Preparation', 'Educational Kids Content'],
277 entertainment: ['Movie Reviews', 'Comedy Skits', 'Reaction Videos', 'Celebrity News', 'TV Show Recaps', 'Stand-up Comedy', 'Viral Challenges', 'Pop Culture'],
278 lifestyle: ['Home Decor', 'Organization Tips', 'Minimalism', 'Self Improvement', 'Productivity', 'Morning Routines', 'Life Hacks', 'Personal Development'],
279 fitness: ['Workout Routines', 'Nutrition Tips', 'Weight Loss', 'Yoga', 'Bodybuilding', 'Running', 'Mental Health', 'Healthy Recipes'],
129 </label>
130 <input type="text" id="customSubNiche" name="customSubNiche"
131 placeholder="e.g., React tutorials, Vegan recipes..."
132 class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-purple-500">
133 </div>
436 gaming: ['Game Reviews', 'Let\'s Play', 'Gaming News', 'Esports', 'Game Development', 'Mobile Gaming', 'Retro Gaming', 'Gaming Hardware'],
437 education: ['Online Courses', 'Language Learning', 'Math Tutorials', 'Science Experiments', 'History Lessons', 'Study Tips', 'Test Preparation', 'Educational Kids Content'],
438 entertainment: ['Movie Reviews', 'Comedy Skits', 'Reaction Videos', 'Celebrity News', 'TV Show Recaps', 'Stand-up Comedy', 'Viral Challenges', 'Pop Culture'],
439 lifestyle: ['Home Decor', 'Organization Tips', 'Minimalism', 'Self Improvement', 'Productivity', 'Morning Routines', 'Life Hacks', 'Personal Development'],
440 fitness: ['Workout Routines', 'Nutrition Tips', 'Weight Loss', 'Yoga', 'Bodybuilding', 'Running', 'Mental Health', 'Healthy Recipes'],
59 </label>
60 <input type="text" id="customSubNiche" name="customSubNiche"
61 placeholder="e.g., React tutorials, Vegan recipes..."
62 class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
63 </div>
285 'Movie Reviews',
286 'Comedy Skits',
287 'Reaction Videos',
288 'Celebrity News',
289 'TV Show Recaps',