diff --git a/frontend/src/pages/StringVisualizer.jsx b/frontend/src/pages/StringVisualizer.jsx
index f771049..73038ee 100644
--- a/frontend/src/pages/StringVisualizer.jsx
+++ b/frontend/src/pages/StringVisualizer.jsx
@@ -1,12 +1,21 @@
import React, { useState } from 'react';
-import { useTheme } from '../contexts/ThemeContext'; // Use the project's theme system
-import { Play, RotateCcw, Text, Hash } from 'lucide-react';
+// STEP 1: Add 'BookOpen' to the import list
+import { Play, RotateCcw, Text, Hash, BookOpen } from 'lucide-react';
+import { useTheme } from '../contexts/ThemeContext';
const StringVisualizer = () => {
- const { classes } = useTheme(); // Get the theme classes
+ const { isDark } = useTheme();
const [text, setText] = useState('ababcabcabababd');
const [pattern, setPattern] = useState('abababd');
+ // STEP 2: Add the new state for the explanation text
+ const [showDetailedLog, setShowDetailedLog] = useState(false);
+ const [explanation, setExplanation] = useState({
+ operation: 'Ready to start.',
+ details: 'Enter text and a pattern, then click Visualize to begin the process.',
+ algorithmInfo: 'The Naive (or Brute-Force) search algorithm checks for a match at every possible position in the text.'
+ });
+
const handleVisualize = () => console.log('Visualize clicked!', { text, pattern });
const handleReset = () => {
setText('');
@@ -15,9 +24,8 @@ const StringVisualizer = () => {
};
return (
- // Use the theme's background class
-
- {/* Spacer div */}
+
+ {/* Spacer to push content down from the main site navigation */}
{/* 1. Gradient Header Card */}
@@ -32,16 +40,16 @@ const StringVisualizer = () => {