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 {
|
interface FolderViewProps {
|
||||||
|
folderParticle: Particle;
|
||||||
networkId: string;
|
networkId: string;
|
||||||
particleSegments: string[];
|
particleSegments: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
export function FolderView({ networkId, particleSegments, folderParticle }: FolderViewProps) {
|
||||||
* Folder-specific view — will eventually show children as cards/list.
|
const { children, error, isLoading } = useParticleChildren(networkId, particleSegments);
|
||||||
* Placeholder for now.
|
|
||||||
*/
|
|
||||||
export function FolderView({ networkId, particleSegments }: FolderViewProps) {
|
|
||||||
return (
|
return (
|
||||||
<div className="flex h-full items-center justify-center">
|
<div className="flex h-full items-center justify-center">
|
||||||
<p className="text-muted-foreground text-sm">
|
<p className="text-muted-foreground text-sm">
|
||||||
|
|||||||
@@ -45,9 +45,9 @@ export function ParticleViewResolver({ networkId, particleSegments }: ParticleVi
|
|||||||
|
|
||||||
switch (particle.type) {
|
switch (particle.type) {
|
||||||
case "stream":
|
case "stream":
|
||||||
return <StreamView networkId={networkId} particleSegments={particleSegments} />;
|
return <StreamView streamParticle={particle} networkId={networkId} particleSegments={particleSegments} />;
|
||||||
case "folder":
|
case "folder":
|
||||||
return <FolderView networkId={networkId} particleSegments={particleSegments} />;
|
return <FolderView folderParticle={particle} networkId={networkId} particleSegments={particleSegments} />;
|
||||||
default:
|
default:
|
||||||
// For container types we haven't built a view for, fall back to list
|
// For container types we haven't built a view for, fall back to list
|
||||||
if (isContainerType(particle.type)) {
|
if (isContainerType(particle.type)) {
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
|
import { Particle } from "@/api/types";
|
||||||
|
import { useParticleChildren } from "@/hooks/use-particle-children";
|
||||||
|
|
||||||
interface StreamViewProps {
|
interface StreamViewProps {
|
||||||
|
streamParticle: Particle;
|
||||||
networkId: string;
|
networkId: string;
|
||||||
particleSegments: string[];
|
particleSegments: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
export function StreamView({ networkId, particleSegments, streamParticle }: StreamViewProps) {
|
||||||
* Stream-specific view — will eventually show media/text children in playback order.
|
const { children, error, isLoading } = useParticleChildren(networkId, particleSegments);
|
||||||
* Placeholder for now.
|
|
||||||
*/
|
|
||||||
export function StreamView({ networkId, particleSegments }: StreamViewProps) {
|
|
||||||
return (
|
return (
|
||||||
<div className="flex h-full items-center justify-center">
|
<div className="flex h-full items-center justify-center">
|
||||||
<p className="text-muted-foreground text-sm">
|
<p className="text-muted-foreground text-sm">
|
||||||
|
|||||||
Reference in New Issue
Block a user