update admin dashboard & landing page editor
This commit is contained in:
33
apps/next/src/components/landing/page-builder.tsx
Normal file
33
apps/next/src/components/landing/page-builder.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
import type { LandingPageBlock } from './content';
|
||||
import { CTA } from './cta';
|
||||
import { Features } from './features';
|
||||
import { Hero } from './hero';
|
||||
import { TechStack } from './tech-stack';
|
||||
|
||||
interface LandingPageBuilderProps {
|
||||
blocks: LandingPageBlock[];
|
||||
}
|
||||
|
||||
export const LandingPageBuilder = ({ blocks }: LandingPageBuilderProps) => {
|
||||
return blocks.map((block, index) => {
|
||||
const key = block.id ?? `${block.blockType}-${index}`;
|
||||
|
||||
switch (block.blockType) {
|
||||
case 'hero': {
|
||||
return <Hero key={key} content={block} />;
|
||||
}
|
||||
case 'features': {
|
||||
return <Features key={key} content={block} />;
|
||||
}
|
||||
case 'techStack': {
|
||||
return <TechStack key={key} content={block} />;
|
||||
}
|
||||
case 'cta': {
|
||||
return <CTA key={key} content={block} />;
|
||||
}
|
||||
default: {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user