SURRENDER...

This commit is contained in:
2025-03-31 22:40:58 +02:00
parent c4e6232462
commit 83081b47d9
6 changed files with 106 additions and 47 deletions

View File

@@ -9,10 +9,16 @@ async function fetchContacts() {
export const Route = createFileRoute('/_sidebar')({
component: Sidebar,
loader: fetchContacts,
notFoundComponent: () => <div>Not Found</div>,
});
function Sidebar() {
const { contacts } = Route.useLoaderData();
const cazzo = Route.useLoaderData();
if (cazzo === undefined) {
console.log("SIDEBAR ERROR!?");
return <div>CANE DIO SIDEBAR MORTE</div>;
}
const { contacts } = cazzo;
return (
<>
@@ -40,7 +46,7 @@ function Sidebar() {
<ul>
{contacts.map((contact) => (
<li key={contact.id}>
<Link to="/contacts/$contractId" params={{ contractId: contact.id }}>
<Link to="/contacts/$contactId" params={{ contactId: contact.id }}>
{contact.first || contact.last ? (
<>
{contact.first} {contact.last}