aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/src/pages/Settings.tsx
blob: b10cbf1ab01d213ccabb3ddd9e9b9e8f06c1e851 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { useQuery } from "urql";
import { AddFeedForm, FeedList } from "../components";
import { GetFeedsDocument } from "../graphql/generated/graphql";

export function Settings() {
	const [, refetchFeeds] = useQuery({
		query: GetFeedsDocument,
	});

	const handleFeedAdded = () => {
		refetchFeeds();
	};

	const handleFeedUnsubscribed = () => {
		refetchFeeds();
	};

	return (
		<div className="mx-auto max-w-4xl">
			<h1 className="mb-6 text-2xl font-bold text-gray-900">Feed Settings</h1>

			{/* Subscribe to New Feed Section */}
			<div className="mb-8">
				<h2 className="mb-4 text-xl font-semibold text-gray-800">
					Subscribe to New Feed
				</h2>
				<AddFeedForm onFeedAdded={handleFeedAdded} />
			</div>

			{/* Manage Feeds Section */}
			<div className="mb-8">
				<h2 className="mb-4 text-xl font-semibold text-gray-800">
					Manage Feeds
				</h2>
				<FeedList onFeedUnsubscribed={handleFeedUnsubscribed} />
			</div>
		</div>
	);
}