clean presidio

This commit is contained in:
Biqoz
2026-01-29 00:19:50 +01:00
parent 050474e95b
commit 90b73080e0
11 changed files with 667 additions and 516 deletions

View File

@@ -18,11 +18,11 @@ import { EntityMapping } from "../config/entityLabels"; // Importer l'interface
interface FileUploadComponentProps {
uploadedFile: File | null;
handleFileChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
handleFileChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
sourceText: string;
setSourceText: (text: string) => void;
setUploadedFile: (file: File | null) => void;
onAnonymize?: (category?: string) => void;
onAnonymize?: (category: string) => void;
isProcessing?: boolean;
canAnonymize?: boolean;
isLoadingFile?: boolean;
@@ -30,10 +30,11 @@ interface FileUploadComponentProps {
outputText?: string;
copyToClipboard?: () => void;
downloadText?: () => void;
isExampleLoaded?: boolean;
setIsExampleLoaded?: (loaded: boolean) => void;
entityMappings?: EntityMapping[];
onMappingsUpdate?: (mappings: EntityMapping[]) => void;
selectedCategory?: string;
setSelectedCategory?: (category: string) => void;
}
export const FileUploadComponent = ({
@@ -53,9 +54,12 @@ export const FileUploadComponent = ({
setIsExampleLoaded,
entityMappings,
onMappingsUpdate,
selectedCategory = "pii",
setSelectedCategory,
}: FileUploadComponentProps) => {
const [isDragOver, setIsDragOver] = useState(false);
const [selectedCategory, setSelectedCategory] = useState("pii");
// Remove the duplicate local state declarations:
// const [selectedCategory, setSelectedCategory] = useState("pii");
// Fonction pour valider le type de fichier
const isValidFileType = (file: File) => {
@@ -494,8 +498,8 @@ export const FileUploadComponent = ({
</label>
<select
value={selectedCategory}
onChange={(e) => setSelectedCategory(e.target.value)}
className="px-3 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-[#f7ab6e] focus:border-[#f7ab6e] bg-white"
onChange={(e) => setSelectedCategory?.(e.target.value)}
className="w-full appearance-none bg-white border border-gray-300 text-gray-700 text-xs rounded-md pl-3 pr-8 py-2 focus:outline-none focus:ring-1 focus:ring-[#f7ab6e] focus:border-[#f7ab6e] transition-colors duration-200"
>
<option value="pii">🔒 PII (Données Personnelles)</option>
<option value="business">🏢 Business (Données Métier)</option>
@@ -649,13 +653,11 @@ export const FileUploadComponent = ({
<div className="relative">
<select
value={selectedCategory}
onChange={(e) => setSelectedCategory(e.target.value)}
onChange={(e) => setSelectedCategory?.(e.target.value)}
className="w-full appearance-none bg-white border border-gray-300 text-gray-700 text-xs rounded-md pl-3 pr-8 py-2 focus:outline-none focus:ring-1 focus:ring-[#f7ab6e] focus:border-[#f7ab6e] transition-colors duration-200"
>
<option value="pii">🔒 PII (Données Personnelles)</option>
<option value="business">
🏢 Business (Données Métier)
</option>
<option value="business">🏢 Business (Données Métier)</option>
<option value="pii_business">🔒🏢 PII + Business </option>
</select>
<div className="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-700">