|
1 | 1 | 'use client' |
2 | 2 |
|
3 | 3 | import { useState } from 'react' |
4 | | -import { Button, ChipInput, cn } from '@sim/emcn' |
| 4 | +import { ChipInput, cn } from '@sim/emcn' |
5 | 5 | import { Search, X } from '@sim/emcn/icons' |
6 | 6 | import type { ColumnDefinition, WorkflowGroup } from '@/lib/table' |
| 7 | +import { |
| 8 | + TableSidebarHeader, |
| 9 | + TableSidebarHeaderAction, |
| 10 | +} from '@/app/workspace/[workspaceId]/tables/[tableId]/components/table-sidebar-header/table-sidebar-header' |
7 | 11 | import { ALL_ENRICHMENTS } from '@/enrichments' |
8 | 12 | import { getEnrichment } from '@/enrichments/registry' |
9 | 13 | import type { EnrichmentConfig as EnrichmentDef } from '@/enrichments/types' |
@@ -71,19 +75,12 @@ function EnrichmentsSidebarBody({ |
71 | 75 | if (editGroup && !editEnrichment) { |
72 | 76 | return ( |
73 | 77 | <div className='flex h-full flex-col'> |
74 | | - <div className='flex min-h-[48px] items-center justify-between border-[var(--border)] border-b px-3 py-[8.5px]'> |
| 78 | + <TableSidebarHeader> |
75 | 79 | <h2 className='text-[var(--text-primary)] text-small'>Enrichment</h2> |
76 | | - <Button |
77 | | - variant='ghost' |
78 | | - size='sm' |
79 | | - onClick={onClose} |
80 | | - iconPadding='sm' |
81 | | - className='size-7 flex-none' |
82 | | - aria-label='Close' |
83 | | - > |
| 80 | + <TableSidebarHeaderAction onClick={onClose} className='flex-none' aria-label='Close'> |
84 | 81 | <X className='size-[14px]' /> |
85 | | - </Button> |
86 | | - </div> |
| 82 | + </TableSidebarHeaderAction> |
| 83 | + </TableSidebarHeader> |
87 | 84 | <div className='flex flex-1 items-center justify-center px-6 text-center'> |
88 | 85 | <p className='text-[var(--text-tertiary)] text-small'> |
89 | 86 | This enrichment ("{editGroup.enrichmentId}") is no longer available. Delete the column |
@@ -118,19 +115,12 @@ function EnrichmentsSidebarBody({ |
118 | 115 |
|
119 | 116 | return ( |
120 | 117 | <div className='flex h-full flex-col'> |
121 | | - <div className='flex min-h-[48px] items-center justify-between border-[var(--border)] border-b px-3 py-[8.5px]'> |
| 118 | + <TableSidebarHeader> |
122 | 119 | <h2 className='text-[var(--text-primary)] text-small'>Enrichments</h2> |
123 | | - <Button |
124 | | - variant='ghost' |
125 | | - size='sm' |
126 | | - onClick={onClose} |
127 | | - iconPadding='sm' |
128 | | - className='size-7 flex-none' |
129 | | - aria-label='Close' |
130 | | - > |
| 120 | + <TableSidebarHeaderAction onClick={onClose} className='flex-none' aria-label='Close'> |
131 | 121 | <X className='size-[14px]' /> |
132 | | - </Button> |
133 | | - </div> |
| 122 | + </TableSidebarHeaderAction> |
| 123 | + </TableSidebarHeader> |
134 | 124 |
|
135 | 125 | <div className='px-2 pt-3'> |
136 | 126 | <ChipInput |
|
0 commit comments