26 lines
755 B
JavaScript
26 lines
755 B
JavaScript
import React, { useEffect } from "react";
|
|
import { useSubscription } from "@apollo/react-hooks";
|
|
import AlertComponent from "../../components/alert/alert.component";
|
|
import { Col } from "antd";
|
|
import { SUBSCRIPTION_ALL_OPEN_JOBS } from "../../graphql/jobs.queries";
|
|
|
|
import JobsList from "../../components/jobs-list/jobs-list.component";
|
|
|
|
export default function JobsPage() {
|
|
const { loading, error, data } = useSubscription(SUBSCRIPTION_ALL_OPEN_JOBS, {
|
|
fetchPolicy: "network-only"
|
|
});
|
|
|
|
useEffect(() => {
|
|
document.title = "new title";
|
|
}, []);
|
|
|
|
if (error) return <AlertComponent message={error.message} />;
|
|
|
|
return (
|
|
<Col span={22} offset={1}>
|
|
<JobsList loading={loading} jobs={data ? data.jobs : null} />
|
|
</Col>
|
|
);
|
|
}
|