import { client } from "@/util/api";
import {
Divider,
NavLink,
Text,
Container,
Button,
ScrollArea,
Stack,
} from "@mantine/core";
import { Link, useLocation } from "@remix-run/react";
import { IconPlus } from "@tabler/icons-react";
import { useQuery, useQueryClient } from "@tanstack/react-query";
export function FlightsList() {
const queryClient = useQueryClient();
const flights = useQuery({
queryKey: ["flights-list"],
queryFn: () => client.get(`/flights`).then((res) => res.data),
});
const location = useLocation();
const page = location.pathname.split("/")[3];
return (
} mb="md">
Add
{flights.data ? (
flights.data.map((flight, index) => (
))
) : (
No Flights
)}
);
}
export function MobileFlightsList() {
const queryClient = useQueryClient();
const flights = useQuery({
queryKey: ["flights-list"],
queryFn: () => client.get(`/flights`).then((res) => res.data),
});
const location = useLocation();
const page = location.pathname.split("/")[3];
return (
{flights.data ? (
flights.data.map((flight, index) => (
))
) : (
No Flights
)}
} mt="md">
Add
);
}
export default { FlightsList, MobileFlightsList };