fetchRssForSubcurrentindex.ts10 matches
76}
7778// ===== CORE PROCESSING FUNCTIONS =====
7980/**
83* @returns {string} ISO 8601 formatted date string
84*/
85function parseDate(dateStr) {
86if (!dateStr) return new Date().toISOString();
87const date = new Date(dateStr);
94* @returns {string} The preprocessed HTML content
95*/
96function preprocessHtmlSnippet(html) {
97if (!html) return '';
98139* @returns {string|undefined} Image URL if found
140*/
141function extractImageUrl(item) {
142// Try enclosure
143const enclosure = item.enclosure;
183* @returns {Object[]} Array of parsed feed entries
184*/
185function parseRssXml(xmlContent) {
186try {
187const parser = new XMLParser({
247* @returns {Object} The processed entry
248*/
249function convertApiEntryToProcessedEntry(apiEntry, feed, fetchedAt) {
250return {
251title: apiEntry.title || '',
265* @returns {Promise<string>} Raw XML content
266*/
267async function fetchFeedContent(url) {
268const controller = new AbortController();
269const timeoutId = setTimeout(() => controller.abort(), 10000); // 10 second timeout
297* @returns {Promise<Object>} Processed feed result
298*/
299async function processSingleFeed(feed) {
300const startTime = Date.now();
301const fetchedAt = new Date().toISOString();
359* @returns {Promise<ApiResponse>} Complete API response
360*/
361async function processMultipleFeeds(
362feeds: Feed[],
363options: ProcessingOptions = {}
445* Processes RSS feeds and returns optimized, pre-processed entries
446*/
447export default async function (req) {
448const corsHeaders = {
449'Access-Control-Allow-Origin': '*',
personalShopperindex.tsx8 matches
13}
1415function LoginPage(): JSX.Element {
16return (
17<div className="min-h-screen flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8">
60}
6162function Navbar({ userData }: { userData: UserData }): JSX.Element {
63const handleLogout = async (): Promise<void> => {
64try {
97}
9899function DashboardCard({
100title,
101count,
133}
134135function LocationSearch({ onLocationSelected }: { onLocationSelected?: () => void }): JSX.Element {
136const [zipCode, setZipCode] = useState("");
137const [locations, setLocations] = useState<Location[]>([]);
347}
348349function CurrentLocationIndicator({
350location,
351onClick,
428}
429430function ShoppingListCreator(): JSX.Element {
431const [listText, setListText] = useState("");
432const [isFocused, setIsFocused] = useState(false);
516}
517518function Dashboard({ userData }: { userData: UserData }): JSX.Element {
519const [guidanceCount, setGuidanceCount] = useState<string>("Loading...");
520const [selectionsCount, setSelectionsCount] = useState<string>("Loading...");
658}
659660function App(): JSX.Element {
661const userData = (window as any).__USER_DATA__;
662return userData ? <Dashboard userData={userData} /> : <LoginPage />;
personalShopperindex.ts1 match
5152// Middleware to get current user from session
53async function getCurrentUser(c: any) {
54const sessionId = await getSignedCookie(
55c,
6interface GameProps {}
78function Game({}: GameProps) {
9const [gameState, setGameState] = useState<GameState | null>(null);
10const [playerId, setPlayerId] = useState<string>('');
14const games = new Map<string, GameState>();
1516function createGame(gameId: string): GameState {
17return {
18id: gameId,
31};
3233export function generateTiles(count: number = 30): Tile[] {
34const tiles: Tile[] = [];
35const letters: string[] = [];
58}
5960export function isValidWord(word: string): boolean {
61// Simple word validation - in a real game you'd use a dictionary API
62// For now, just check it's at least 3 letters and contains only letters
64}
6566export function canFormWord(word: string, availableTiles: Tile[]): { canForm: boolean; usedTiles: Tile[] } {
67const wordLetters = word.toUpperCase().split('');
68const flippedTiles = availableTiles.filter(tile => tile.isFlipped);
82}
8384export function calculateWordScore(tiles: Tile[]): number {
85return tiles.reduce((sum, tile) => sum + tile.points, 0);
86}
PresentationsNotice.tsx1 match
9}
1011export function Notice({ notice, confirm = false, confirmFunc, cancelFunc }: NoticeProps) {
12if (!notice || notice.length === 0) return null;
13
9}
1011export function AddPresentation({ numPresentations, onRefresh }: AddPresentationProps) {
12const [titleInput, setTitleInput] = useState("");
13const [presenterInput, setPresenterInput] = useState("");
10}
1112export function PresentationItem({ presentation, editable, onRefresh }: PresentationItemProps) {
13const [titleInput, setTitleInput] = useState(presentation.title);
14const [presenterInput, setPresenterInput] = useState(presentation.presenter);
PresentationsTimer.tsx1 match
3import { displayAsMinutes } from "../../shared/utils.ts";
45export function Timer() {
6const [timerIsRunning, setTimerIsRunning] = useState(false);
7const [startedAt, setStartedAt] = useState<number | null>(null);