import { useState } from 'react';
export default function ProfileProofPicker({
documents,
value,
onChange,
disabled = false,
}: {
documents: { id: string; file_name: string }[];
value: string[];
onChange: (ids: string[]) => void;
disabled?: boolean;
}) {
const [query, setQuery] = useState('');
const [showAll, setShowAll] = useState(false);
const [limit, setLimit] = useState(10);
const normalize = (text: string) =>
text
.normalize('NFD')
.replace(/\p{Diacritic}/gu, '')
.toLocaleLowerCase();
const matches = documents.filter((document) =>
normalize(document.file_name).includes(normalize(query)),
);
const toggle = (id: string) =>
onChange(
value.includes(id)
? value.filter((item) => item !== id)
: [...value, id],
);
return (
);
}