import { useMemo } from "react"; import { useComposeKeyboard } from "@/features/compose/use-compose-keyboard"; import { useNavigate } from "react-router-dom"; import { Radio } from "lucide-react"; import { useLiveParticleChildren } from "@/hooks/use-particle"; import { parseParticlePath, type ParticlePath } from "@/lib/particle-path"; import { Avatar, AvatarFallback } from "@/components/ui/avatar"; import { ScrollArea } from "@/components/ui/scroll-area"; import { Separator } from "@/components/ui/separator"; import { Progress } from "@/components/ui/progress"; import { Small } from "@/components/ui/typography"; import ControlsIndicator from "@/features/compose/controls-indicator"; import type { Particle, StreamProperties } from "@/api/types"; function StreamRow({ particle, onClick, }: { particle: Particle & { type: "stream"; properties: StreamProperties }; onClick: () => void; }) { const initials = particle.properties.name.slice(0, 2).toUpperCase(); return ( ); } interface ParticleListViewProps { path: ParticlePath; } /** * List of stream particles for a container (network root, folder, etc.). */ export function ParticleListView({ path }: ParticleListViewProps) { useComposeKeyboard(); const { children, isLoading } = useLiveParticleChildren(path); const { networkId } = parseParticlePath(path); const navigate = useNavigate(); const streams = useMemo( () => children.filter((c) => c.type === "stream"), [children], ); if (isLoading) { return ; } if (streams.length === 0) { return (