1- // apps/website/src/components/landing/angular/AngularCodeShowcase.tsx
2- 'use client' ;
3- import { motion } from 'framer-motion' ;
41import { tokens } from '@cacheplane/design-tokens' ;
2+ import { HighlightedCode } from '../HighlightedCode' ;
53
64const SNIPPET_1 = `import { agent } from '@cacheplane/angular';
75
@@ -27,16 +25,15 @@ provideAgent({
2725 : new FetchStreamTransport(),
2826});` ;
2927
30- export function AngularCodeShowcase ( ) {
28+ const SNIPPETS = [
29+ { title : 'Minimal Setup' , code : SNIPPET_1 , lang : 'typescript' } ,
30+ { title : 'Full Configuration' , code : SNIPPET_2 , lang : 'typescript' } ,
31+ ] ;
32+
33+ export async function AngularCodeShowcase ( ) {
3134 return (
3235 < section style = { { padding : '80px 32px' } } >
33- < motion . div
34- initial = { { opacity : 0 , y : 16 } }
35- whileInView = { { opacity : 1 , y : 0 } }
36- viewport = { { once : true } }
37- transition = { { duration : 0.5 } }
38- style = { { textAlign : 'center' , marginBottom : 48 } }
39- >
36+ < div style = { { textAlign : 'center' , marginBottom : 48 } } >
4037 < p style = { {
4138 fontFamily : 'var(--font-mono,"JetBrains Mono",monospace)' ,
4239 fontSize : '0.7rem' , textTransform : 'uppercase' , letterSpacing : '0.12em' ,
@@ -51,19 +48,15 @@ export function AngularCodeShowcase() {
5148 } } >
5249 Production streaming in a few lines
5350 </ h2 >
54- </ motion . div >
51+ </ div >
5552
5653 < div style = { {
5754 maxWidth : 900 , margin : '0 auto' ,
5855 display : 'grid' , gridTemplateColumns : 'repeat(auto-fit, minmax(min(380px, 100%), 1fr))' , gap : 24 ,
5956 } } >
60- { [ { title : 'Minimal Setup' , code : SNIPPET_1 } , { title : 'Full Configuration' , code : SNIPPET_2 } ] . map ( ( s , i ) => (
61- < motion . div
57+ { SNIPPETS . map ( ( s ) => (
58+ < div
6259 key = { s . title }
63- initial = { { opacity : 0 , y : 20 } }
64- whileInView = { { opacity : 1 , y : 0 } }
65- viewport = { { once : true } }
66- transition = { { duration : 0.45 , delay : i * 0.1 } }
6760 style = { { borderRadius : 14 , overflow : 'hidden' , border : `1px solid ${ tokens . glass . border } ` } }
6861 >
6962 < div style = { {
@@ -77,14 +70,8 @@ export function AngularCodeShowcase() {
7770 { s . title }
7871 </ span >
7972 </ div >
80- < pre style = { {
81- background : '#1a1b26' , color : '#c8ccee' , padding : '20px 24px' ,
82- fontSize : '0.78rem' , lineHeight : 1.65 , margin : 0 , overflowX : 'auto' ,
83- fontFamily : "'JetBrains Mono', monospace" ,
84- } } >
85- < code > { s . code } </ code >
86- </ pre >
87- </ motion . div >
73+ < HighlightedCode code = { s . code } lang = { s . lang } />
74+ </ div >
8875 ) ) }
8976 </ div >
9077 </ section >
0 commit comments