Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,22 @@ import { ImagePreviewModal } from './components/ImagePreviewModal';
// ============================================================================
function App() {
// Detection Settings (persisted to localStorage)
const { settings, updateSetting, addToAllowlist, removeFromAllowlist, resetAllowlist } = useDetectionSettings();
const {
settings,
updateSetting,
addToAllowlist,
removeFromAllowlist,
resetAllowlist,
addBlockWord,
removeBlockWord,
resetBlockWords,
addCustomDate,
removeCustomDate,
resetCustomDates,
addCustomRegex,
removeCustomRegex,
resetCustomRegex,
} = useDetectionSettings();

// Hooks
const {
Expand Down Expand Up @@ -132,6 +147,15 @@ function App() {
onAddToAllowlist={addToAllowlist}
onRemoveFromAllowlist={removeFromAllowlist}
onResetAllowlist={resetAllowlist}
onAddBlockWord={addBlockWord}
onRemoveBlockWord={removeBlockWord}
onResetBlockWords={resetBlockWords}
onAddCustomDate={addCustomDate}
onRemoveCustomDate={removeCustomDate}
onResetCustomDates={resetCustomDates}
onAddCustomRegex={addCustomRegex}
onRemoveCustomRegex={removeCustomRegex}
onResetCustomRegex={resetCustomRegex}
/>

<main className="max-w-6xl mx-auto px-6 py-12 flex-grow w-full">
Expand Down
30 changes: 30 additions & 0 deletions src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ interface HeaderProps {
onAddToAllowlist?: (value: string) => void;
onRemoveFromAllowlist?: (value: string) => void;
onResetAllowlist?: () => void;
// Block Words
onAddBlockWord?: (word: string) => void;
onRemoveBlockWord?: (word: string) => void;
onResetBlockWords?: () => void;
// Custom Dates
onAddCustomDate?: (dateStr: string) => string | null;
onRemoveCustomDate?: (dateStr: string) => void;
onResetCustomDates?: () => void;
// Custom Regex
onAddCustomRegex?: (pattern: string, caseSensitive: boolean, label?: string) => string | null;
onRemoveCustomRegex?: (id: string) => void;
onResetCustomRegex?: () => void;
}

export function Header({
Expand All @@ -15,6 +27,15 @@ export function Header({
onAddToAllowlist,
onRemoveFromAllowlist,
onResetAllowlist,
onAddBlockWord,
onRemoveBlockWord,
onResetBlockWords,
onAddCustomDate,
onRemoveCustomDate,
onResetCustomDates,
onAddCustomRegex,
onRemoveCustomRegex,
onResetCustomRegex,
}: HeaderProps) {
return (
<header className="border-b border-slate-800 bg-slate-900/50 backdrop-blur-sm sticky top-0 z-50">
Expand All @@ -34,6 +55,15 @@ export function Header({
onAddToAllowlist={onAddToAllowlist}
onRemoveFromAllowlist={onRemoveFromAllowlist}
onResetAllowlist={onResetAllowlist}
onAddBlockWord={onAddBlockWord}
onRemoveBlockWord={onRemoveBlockWord}
onResetBlockWords={onResetBlockWords}
onAddCustomDate={onAddCustomDate}
onRemoveCustomDate={onRemoveCustomDate}
onResetCustomDates={onResetCustomDates}
onAddCustomRegex={onAddCustomRegex}
onRemoveCustomRegex={onRemoveCustomRegex}
onResetCustomRegex={onResetCustomRegex}
/>
</div>
</header>
Expand Down
Loading