@@ -968,8 +968,56 @@ const StackBuilder = () => {
968968 } ;
969969
970970 const shareToTwitter = ( ) => {
971+ const getStackSummary = ( ) : string => {
972+ const selectedTechs : string [ ] = [ ] ;
973+
974+ for ( const category of CATEGORY_ORDER ) {
975+ const categoryKey = category as keyof StackState ;
976+ const options = TECH_OPTIONS [ category as keyof typeof TECH_OPTIONS ] ;
977+ const selectedValue = stack [ categoryKey ] ;
978+
979+ if ( ! options ) continue ;
980+
981+ if ( Array . isArray ( selectedValue ) ) {
982+ if (
983+ selectedValue . length === 0 ||
984+ ( selectedValue . length === 1 && selectedValue [ 0 ] === "none" )
985+ ) {
986+ continue ;
987+ }
988+
989+ for ( const id of selectedValue ) {
990+ if ( id === "none" ) continue ;
991+ const tech = options . find ( ( opt ) => opt . id === id ) ;
992+ if ( tech ) {
993+ selectedTechs . push ( tech . name ) ;
994+ }
995+ }
996+ } else {
997+ const tech = options . find ( ( opt ) => opt . id === selectedValue ) ;
998+ if (
999+ ! tech ||
1000+ tech . id === "none" ||
1001+ tech . id === "false" ||
1002+ ( ( category === "git" ||
1003+ category === "install" ||
1004+ category === "auth" ) &&
1005+ tech . id === "true" )
1006+ ) {
1007+ continue ;
1008+ }
1009+ selectedTechs . push ( tech . name ) ;
1010+ }
1011+ }
1012+
1013+ return selectedTechs . length > 0
1014+ ? selectedTechs . join ( " • " )
1015+ : "Custom stack" ;
1016+ } ;
1017+
1018+ const stackSummary = getStackSummary ( ) ;
9711019 const text = encodeURIComponent (
972- " Check out this cool tech stack I configured with Create Better T Stack!\n\n" ,
1020+ ` Check out this cool tech stack I configured with Create Better T Stack!\n\n🚀 ${ stackSummary } \n\n` ,
9731021 ) ;
9741022 if ( typeof window !== "undefined" ) {
9751023 const url = encodeURIComponent ( window . location . href ) ;
0 commit comments