chore: structure container particles for rendering children

This commit is contained in:
talksik
2026-03-17 16:02:39 -07:00
parent 4273e324e5
commit 8207872a0c
3 changed files with 16 additions and 12 deletions
+7 -5
View File
@@ -1,13 +1,15 @@
import { Particle } from "@/api/types";
import { useParticleChildren } from "@/hooks/use-particle-children";
interface FolderViewProps {
folderParticle: Particle;
networkId: string;
particleSegments: string[];
}
/**
* Folder-specific view — will eventually show children as cards/list.
* Placeholder for now.
*/
export function FolderView({ networkId, particleSegments }: FolderViewProps) {
export function FolderView({ networkId, particleSegments, folderParticle }: FolderViewProps) {
const { children, error, isLoading } = useParticleChildren(networkId, particleSegments);
return (
<div className="flex h-full items-center justify-center">
<p className="text-muted-foreground text-sm">
@@ -45,9 +45,9 @@ export function ParticleViewResolver({ networkId, particleSegments }: ParticleVi
switch (particle.type) {
case "stream":
return <StreamView networkId={networkId} particleSegments={particleSegments} />;
return <StreamView streamParticle={particle} networkId={networkId} particleSegments={particleSegments} />;
case "folder":
return <FolderView networkId={networkId} particleSegments={particleSegments} />;
return <FolderView folderParticle={particle} networkId={networkId} particleSegments={particleSegments} />;
default:
// For container types we haven't built a view for, fall back to list
if (isContainerType(particle.type)) {
+7 -5
View File
@@ -1,13 +1,15 @@
import { Particle } from "@/api/types";
import { useParticleChildren } from "@/hooks/use-particle-children";
interface StreamViewProps {
streamParticle: Particle;
networkId: string;
particleSegments: string[];
}
/**
* Stream-specific view — will eventually show media/text children in playback order.
* Placeholder for now.
*/
export function StreamView({ networkId, particleSegments }: StreamViewProps) {
export function StreamView({ networkId, particleSegments, streamParticle }: StreamViewProps) {
const { children, error, isLoading } = useParticleChildren(networkId, particleSegments);
return (
<div className="flex h-full items-center justify-center">
<p className="text-muted-foreground text-sm">