import React from "react"; import FlipMove from "react-flip-move"; import useSWR from "swr"; import { getFlagEmoji } from "../utils/getFlagEmoji.ts"; import { Progress } from "./Progress.tsx"; import { apiClient, handleResponse } from "./apiClient.tsx"; export function QueuePage() { const jobs = useSWR( ["jobs", "GET", {}] as const, (args) => apiClient.fetch(...args).then(handleResponse), { refreshInterval: 2000 }, ); return ( {jobs.data?.map((job) => (
  • {job.place}. {getFlagEmoji(job.state.from.language_code)} {job.state.from.first_name} {job.state.from.last_name} {job.state.from.username ? ( @{job.state.from.username} ) : null} {job.state.progress != null && } {job.state.sdInstanceId}
  • ))}
    ); }