FarcasterSpacesui.tsx9 matches
3import { useEffect, useState } from "https://esm.sh/react@19";
45export function Section({ children, ...props }: any) {
6const sectionClass = `p-5 rounded-3xl bg-neutral-400/15 ${props.className || ""}`;
7return <div class={sectionClass}>{children}</div>;
93};
9495// export function Input(props: any) {
96// const inputClass = "dark:bg-white dark:text-black bg-black text-white rounded-md px-3 py-1 ";
97// return <input class={inputClass} {...props} />;
98// }
99100// export function Button(props: any) {
101// const buttonClass = "dark:bg-white dark:text-black bg-black text-white rounded-md px-3 py-1 ";
102// return <button class={buttonClass} {...props} />;
103// }
104105export function MonoButton(props: any) {
106return (
107<Button {...props}>
111}
112113export function MonoButtonWithStatus(props: any) {
114const [status, setStatus] = useState<any>();
115const handleClick = async () => {
132}
133134export function formatJSON(json: any) {
135return JSON.stringify(json, null, 2);
136}
146};
147148export function BackButton({}) {
149return <ArrowLeft className="w-5 h-5 m-2 cursor-pointer opacity-50" onClick={() => window.location.href = "/"} />;
150}
151152export function ShareButton({ onClick }) {
153return <Share className="w-5 h-5 m-2 cursor-pointer opacity-50" onClick={onClick} />;
154}
155156export function Sheet({ children, showSheet, setShowSheet }: any) {
157return (
158<>
FarcasterSpacesHome.tsx4 matches
10import { supabase } from '../util/db.ts'
1112export function Home() {
13const [context, setContext] = useState<any>()
14useEffect(() => {
37}
3839function Spaces() {
40const queryFn = async () => {
41const agoraChannels = await fetch(`/api/channels`)
79}
8081function Space({ space }: any) {
82const navigate = useNavigate()
8397}
9899function CreateForm({}) {
100const [context, setContext] = useState<any>()
101useEffect(() => {
16}
1718export default function VoiceRecorder({ onVoiceNoteCreated }: VoiceRecorderProps) {
19const [recordingState, setRecordingState] = useState<RecordingState>({
20isRecording: false,
voicemessagesVoicePlayer.tsx1 match
7}
89export default function VoicePlayer({ voiceNoteId }: VoicePlayerProps) {
10const [voiceNote, setVoiceNote] = useState<VoiceNote | null>(null);
11const [loading, setLoading] = useState(true);
voicemessagesDashboard.tsx1 match
3import type { VoiceNote } from "../../shared/types.ts";
45export default function Dashboard() {
6const [voiceNotes, setVoiceNotes] = useState<VoiceNote[]>([]);
7const [loading, setLoading] = useState(true);
voicemessagesApp.tsx1 match
11}
1213export default function App() {
14const [currentView, setCurrentView] = useState<"recorder" | "player" | "dashboard">("recorder");
15const voiceNoteId = window.__VOICE_NOTE_ID__;
voicemessagesvoicenotes.ts2 matches
150apiKey: Deno.env.get("GROQ_API_KEY") || "",
151});
152// Background transcription function
153async function transcribeAudio(voiceNoteId: string, audioBuffer: ArrayBuffer) {
154try {
155// Convert ArrayBuffer to File for OpenAI
nelsongptuseChat.ts1 match
17}
1819export function useChat(): ChatState & ChatActions {
20const [messages, setMessages] = useState<Message[]>([]);
21const [isLoading, setIsLoading] = useState(false);
nelsongptSidebar.tsx1 match
301<li className="flex items-center">
302<span className="w-2 h-2 bg-green-500 rounded-full mr-3"></span>
303Offline functionality
304</li>
305<li className="flex items-center">
8990// Check if request is for a static file
91function isStaticFile(request) {
92const url = new URL(request.url);
93return url.pathname.startsWith('/frontend/') ||
9899// Check if request is for API
100function isAPIRequest(request) {
101const url = new URL(request.url);
102return url.pathname.startsWith('/api/');
104105// Check if request is navigation
106function isNavigationRequest(request) {
107return request.mode === 'navigate';
108}
109110// Handle static files with cache-first strategy
111async function handleStaticFile(request) {
112try {
113const cachedResponse = await caches.match(request);
144145// Handle API requests with network-first strategy
146async function handleAPIRequest(request) {
147try {
148const networkResponse = await fetch(request);
185186// Handle navigation requests
187async function handleNavigationRequest(request) {
188try {
189const networkResponse = await fetch(request);
226227// Handle other dynamic requests
228async function handleDynamicRequest(request) {
229try {
230const networkResponse = await fetch(request);
258259// Sync offline messages when connection is restored
260async function syncOfflineMessages() {
261try {
262// This would integrate with IndexedDB to sync offline messages