export interface Todo {
id: string;
title: string;
done: boolean;
pending: boolean;
}
import { useEffect, useRef } from "react";
const FOCUSABLE = [
"a[href]",
"button:not([disabled])",
"textarea:not([disabled])",
import { z } from 'zod';
export const signupSchema = z
.object({
email: z.string().min(1, 'Email is required').email('Enter a valid email'),
password: z
export const FLAG_REGISTRY = {
newDashboard: {
default: false as boolean,
description: 'Renders the redesigned dashboard shell',
},
maxUploadMb: {
import { z } from "zod";
export const signupSchema = z
.object({
email: z.string().min(1, "Email is required").email("Enter a valid email"),
username: z
import { useCallback, useEffect, useState } from "react";
type Patch = Record<string, string | null | undefined>;
function readParams(): URLSearchParams {
return new URLSearchParams(window.location.search);
import React, { useState, useEffect, useCallback, useMemo, useRef, useContext } from 'react';
// 1. useState - managing component state
function Counter() {
const [count, setCount] = useState(0);
const [name, setName] = useState('');
export const initialState = (steps, initialData = {}) => ({
steps,
stepIndex: 0,
data: initialData,
errors: {},
});
export interface Todo {
id: string;
title: string;
done: boolean;
}
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);
export interface Post {
id: string;
body: string;
liked: boolean;
likeCount: number;
}