import { useState } from "preact/hooks"; export type ImportResult = { added: number; modified: number; ignored: number; errors: number; details: ImportDetail[]; }; export type ImportDetail = { type: "change" | "error"; message: string; }; type Props = { result: ImportResult; onClose: () => void; }; export default function ImportResultPopup({ result, onClose }: Props) { const [showDetails, setShowDetails] = useState(false); const hasErrors = result.errors > 0; const changes = result.details.filter((d) => d.type === "change"); const errors = result.details.filter((d) => d.type === "error"); return (
); }