import { useMemo, useCallback } from 'react';
import { useSearchParams } from 'react-router-dom';
function parseFilters(params) {
return {
q: params.get('q') || '',
export interface Todo {
id: string;
title: string;
done: boolean;
}
import React, { createContext, useContext, useState, ReactNode } from 'react'
interface TabsContextType {
activeTab: string
setActiveTab: (tab: string) => void
}
import { createContext } from "react";
export type ToastVariant = "info" | "success" | "error";
export interface Toast {
id: string;
import { useState, useRef, useEffect, useCallback } from "react";
export function useCarousel(length, { delay = 4000 } = {}) {
const [index, setIndex] = useState(0);
const [paused, setPaused] = useState(false);
const savedCallback = useRef(null);
const { EventEmitter } = require('events');
class NotificationBus extends EventEmitter {
constructor(bufferSize = 100) {
super();
this.setMaxListeners(0);
import { useCallback, useEffect, useRef, useState } from "react";
export function useIntersectionObserver(options?: IntersectionObserverInit) {
const [isIntersecting, setIsIntersecting] = useState(false);
const nodeRef = useRef<Element | null>(null);
const optionsKey = JSON.stringify(options ?? {});
export class TimeoutError extends Error {
constructor(public readonly ms: number) {
super(`Request timed out after ${ms}ms`);
this.name = "TimeoutError";
}
}
import { Link } from 'react-router-dom'
import { useQueryClient } from '@tanstack/react-query'
import api from '@/services/api'
import { PostId } from '@/types'
interface PostLinkProps {
import React from 'react'
interface SkeletonProps {
width?: string | number
height?: string | number
className?: string
export interface Post {
id: string;
body: string;
liked: boolean;
likeCount: number;
}
import React from 'react';
export function UndoSnackbar({ pending, onUndo }) {
if (!pending) return null;
return (