import { Box, Heading, VStack, Text, Button, OrderedList, ListItem, useDisclosure, Modal, ModalOverlay, ModalContent, ModalHeader, ModalBody, ModalFooter, useToast, IconButton, Flex } from "@chakra-ui/react"; import { ChevronLeftIcon } from "@chakra-ui/icons"; import { useNavigate } from "react-router-dom"; import { useXmlParser } from "../hooks/useXmlParser"; import { StyledFileInput } from "../components/StyledFileInput"; import { api } from "../services/api"; export function Configuration() { const { resetLibrary } = useXmlParser(); const { isOpen, onOpen, onClose } = useDisclosure(); const toast = useToast(); const navigate = useNavigate(); const handleResetDatabase = async () => { try { await api.resetDatabase(); await resetLibrary(); onClose(); toast({ title: "Database reset successful", description: "Your library has been cleared.", status: "success", duration: 5000, isClosable: true, }); // Navigate to homepage to show welcome modal and start fresh navigate('/'); } catch (error) { toast({ title: "Failed to reset database", description: "An error occurred while resetting the database.", status: "error", duration: 5000, isClosable: true, }); } }; return ( } aria-label="Go back" variant="ghost" onClick={() => navigate('/')} color="gray.300" _hover={{ color: "white", bg: "whiteAlpha.200" }} /> Configuration Library Management To get started with Rekordbox Reader, you'll need to export your library from Rekordbox and import it here. Open Rekordbox and go to File → Export Collection in xml format Choose a location to save your XML file Click the button below to import your Rekordbox XML file Import Library Reset Database Clear all songs and playlists from the database. This action cannot be undone. {/* Reset Database Confirmation Modal */} Confirm Database Reset Are you sure you want to reset the database? This will: Delete all imported songs Remove all playlists Clear all custom configurations This action cannot be undone. ); }