import React, { useEffect, useRef, useState } from "react"; import { Button } from "@/app/_components/ui/button"; import { Card, CardContent } from "@/app/_components/ui/card"; import { ScrollArea } from "@/app/_components/ui/scroll-area"; import { Separator } from "@/app/_components/ui/separator"; import { Upload } from "lucide-react"; import { Badge } from "../../ui/badge"; import { IconBrandGoogleAnalytics, IconCsv, IconFileExcel, IconFileWord, IconHtml, IconMarkdown, TablerIcon, } from "@tabler/icons-react"; // Data for import options type ImportOption = { name: string; icon: TablerIcon; beta?: boolean; new?: boolean; sync?: boolean; }; const importOptions: ImportOption[] = [ { name: "Excel", icon: IconFileExcel }, { name: "Google Sheets", icon: IconBrandGoogleAnalytics }, { name: "CSV", icon: IconCsv }, { name: "Text & Markdown", icon: IconMarkdown }, { name: "Word", icon: IconFileWord }, ]; const ImportData = () => { const contentRef = useRef(null); const [isScrollable, setIsScrollable] = useState(false); const scrollAreaHeight = "calc(100vh-140px)"; useEffect(() => { const checkScrollable = () => { if (contentRef.current) { const contentHeight = contentRef.current.scrollHeight; const containerHeight = parseInt( scrollAreaHeight.replace("calc(100vh-", "").replace("px)", "") ); const viewportHeight = window.innerHeight - containerHeight; setIsScrollable(contentHeight > viewportHeight); } }; // Check initially checkScrollable(); // Check on window resize window.addEventListener("resize", checkScrollable); // Clean up event listener return () => window.removeEventListener("resize", checkScrollable); }, []); return (

Import data

Import data from other apps and files into Sigap.

You can import crime data from csv files, text files, and other apps into Sigap.

{importOptions.map((option) => ( {React.createElement(option.icon)}

{option.name}

{option.beta && ( Beta )} {option.new && ( New )} {option.sync && ( Sync )}
))}
{/*

Don't see the app you use? Import a ZIP file, and Notion will convert it.

*/}
); }; export default ImportData;