SURRENDER...
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user