chore: structure container particles for rendering children
This commit is contained in:
@@ -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)) {
|
||||
|
||||
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user