import type { LinksFunction } from "@remix-run/node"; import { Form, Link, Links, Meta, NavLink, Outlet, Scripts, ScrollRestoration, useLoaderData, useNavigation, } from "@remix-run/react"; import { redirect } from "@remix-run/node"; import appStylesHref from "./app.css?url" import { getContacts, createEmptyContact } from "./data"; export const links: LinksFunction = () => [ { rel: "stylesheet", href: appStylesHref }, ]; export const action = async () => { const contact = await createEmptyContact(); return redirect(`/contacts/${contact.id}/edit`) } export const loader = async () => { const contacts = await getContacts(); return { contacts }; }; export default function App() { const { contacts } = useLoaderData(); const navigation = useNavigation(); return (