feat(ui): add notification system (#8394)

Co-authored-by: Pablo Lara <larabjj@gmail.com>
This commit is contained in:
sumit-tft
2025-08-05 12:36:15 +05:30
committed by GitHub
parent af8fbaf2cd
commit cf8402e013
9 changed files with 202 additions and 0 deletions

31
ui/actions/feeds/feeds.ts Normal file
View File

@@ -0,0 +1,31 @@
"use server";
import Parser from "rss-parser";
const RSS_FEED_URL = process.env.RSS_FEED_URL || "";
export const fetchFeeds = async (): Promise<any | any[]> => {
if (RSS_FEED_URL?.trim()?.length > 0) {
const parser = new Parser();
try {
// TODO: Need to update return logic when actual URL is updated for RSS FEED
const feed = await parser.parseURL(RSS_FEED_URL);
return [
{
title: feed.title,
description: feed.description,
link: feed.link,
lastBuildDate: new Date(feed.lastBuildDate).toLocaleString(),
},
];
} catch (error) {
// eslint-disable-next-line no-console
console.error("Error fetching RSS feed:", error);
return [];
}
} else {
// eslint-disable-next-line no-console
console.warn("RSS url not set");
return [];
}
};

View File

@@ -0,0 +1 @@
export * from "./feeds";