import React, { useState } from "react"; import { Text, View } from "react-native"; import { BottomSheetBackdrop, BottomSheetModal, BottomSheetModalProps, BottomSheetView, useBottomSheetModal, } from "@gorhom/bottom-sheet"; import { useCreateBookmarkList } from "@hoarder/shared-react/hooks/lists"; import { Button } from "../ui/Button"; import { Input } from "../ui/Input"; import PageTitle from "../ui/PageTitle"; import { useToast } from "../ui/Toast"; const NewListModal = React.forwardRef< BottomSheetModal, Omit >(({ ...props }, ref) => { const { dismiss } = useBottomSheetModal(); const { toast } = useToast(); const [text, setText] = useState(""); const { mutate, isPending } = useCreateBookmarkList({ onSuccess: () => { dismiss(); }, onError: () => { toast({ message: "Something went wrong", variant: "destructive", }); }, }); const onSubmit = () => { mutate({ name: text, icon: "🚀", }); }; return ( setText("")} backdropComponent={(props) => ( )} {...props} > 🚀