@@ -500,6 +500,12 @@ export function AccessControl() {
500500 return allBlocks . filter ( ( b ) => b . name . toLowerCase ( ) . includes ( query ) )
501501 } , [ allBlocks , integrationSearchTerm ] )
502502
503+ const filteredTriggerBlocks = useMemo ( ( ) => {
504+ return filteredBlocks
505+ . filter ( ( block ) => block . category === 'triggers' )
506+ . sort ( ( a , b ) => a . name . localeCompare ( b . name ) )
507+ } , [ filteredBlocks ] )
508+
503509 const filteredCoreBlocks = useMemo ( ( ) => {
504510 return filteredBlocks . filter ( ( block ) => block . category === 'blocks' )
505511 } , [ filteredBlocks ] )
@@ -1003,8 +1009,43 @@ export function AccessControl() {
10031009 </ Button >
10041010 </ div >
10051011 < div className = 'flex flex-col gap-4' >
1006- { filteredCoreBlocks . length > 0 && (
1012+ { filteredTriggerBlocks . length > 0 && (
10071013 < div className = 'flex flex-col gap-1.5' >
1014+ < span className = 'font-medium text-[var(--text-tertiary)] text-xs uppercase tracking-wide' >
1015+ Triggers
1016+ </ span >
1017+ < div className = 'grid grid-cols-3 gap-x-2 gap-y-0.5' >
1018+ { filteredTriggerBlocks . map ( ( block ) => {
1019+ const BlockIcon = block . icon
1020+ const checkboxId = `block-${ block . type } `
1021+ return (
1022+ < label
1023+ key = { block . type }
1024+ htmlFor = { checkboxId }
1025+ className = 'flex cursor-pointer items-center gap-2 rounded-md px-2 py-[5px] transition-colors hover-hover:bg-[var(--surface-2)]'
1026+ >
1027+ < Checkbox
1028+ id = { checkboxId }
1029+ checked = { isIntegrationAllowed ( block . type ) }
1030+ onCheckedChange = { ( ) => toggleIntegration ( block . type ) }
1031+ />
1032+ < div
1033+ className = 'relative flex h-[16px] w-[16px] flex-shrink-0 items-center justify-center overflow-hidden rounded-sm'
1034+ style = { { background : block . bgColor } }
1035+ >
1036+ { BlockIcon && (
1037+ < BlockIcon className = '!h-[10px] !w-[10px] text-white' />
1038+ ) }
1039+ </ div >
1040+ < span className = 'truncate font-medium text-sm' > { block . name } </ span >
1041+ </ label >
1042+ )
1043+ } ) }
1044+ </ div >
1045+ </ div >
1046+ ) }
1047+ { filteredCoreBlocks . length > 0 && (
1048+ < div className = 'flex flex-col gap-1.5 border-[var(--border)] border-t pt-4' >
10081049 < span className = 'font-medium text-[var(--text-tertiary)] text-xs uppercase tracking-wide' >
10091050 Core Blocks
10101051 </ span >
0 commit comments