@@ -4,6 +4,7 @@ import React, { Fragment, useEffect, useState } from 'react'
4
4
import { useTranslation } from 'react-i18next'
5
5
import {
6
6
RiAddLine ,
7
+ RiMoreFill ,
7
8
} from '@remixicon/react'
8
9
import { useContext } from 'use-context-selector'
9
10
import {
@@ -14,7 +15,6 @@ import Button from '../../../base/button'
14
15
import AddAnnotationModal from '../add-annotation-modal'
15
16
import type { AnnotationItemBasic } from '../type'
16
17
import BatchAddModal from '../batch-add-annotation-modal'
17
- import s from './style.module.css'
18
18
import cn from '@/utils/classnames'
19
19
import CustomPopover from '@/app/components/base/popover'
20
20
import { FileDownload02 , FilePlus02 } from '@/app/components/base/icons/src/vender/line/files'
@@ -80,17 +80,17 @@ const HeaderOptions: FC<Props> = ({
80
80
const Operations = ( ) => {
81
81
return (
82
82
< div className = "w-full py-1" >
83
- < button className = { s . actionItem } onClick = { ( ) => {
83
+ < button className = 'h-9 py-2 px-3 mx-1 flex items-center space-x-2 hover:bg-components-panel-on-panel-item-bg-hover rounded-lg cursor-pointer disabled:opacity-50 w-[calc(100%_-_8px)]' onClick = { ( ) => {
84
84
setShowBulkImportModal ( true )
85
85
} } >
86
- < FilePlus02 className = { s . actionItemIcon } />
87
- < span className = { s . actionName } > { t ( 'appAnnotation.table.header.bulkImport' ) } </ span >
86
+ < FilePlus02 className = 'w-4 h-4 text-text-tertiary' />
87
+ < span className = 'grow text-text-secondary system-sm-regular text-left' > { t ( 'appAnnotation.table.header.bulkImport' ) } </ span >
88
88
</ button >
89
89
< Menu as = "div" className = "relative w-full h-full" >
90
- < Menu . Button className = { s . actionItem } >
91
- < FileDownload02 className = { s . actionItemIcon } />
92
- < span className = { s . actionName } > { t ( 'appAnnotation.table.header.bulkExport' ) } </ span >
93
- < ChevronRight className = 'shrink-0 w-[14px] h-[14px] text-gray-500 ' />
90
+ < Menu . Button className = 'h-9 py-2 px-3 mx-1 flex items-center space-x-2 hover:bg-components-panel-on-panel-item-bg-hover rounded-lg cursor-pointer disabled:opacity-50 w-[calc(100%_-_8px)]' >
91
+ < FileDownload02 className = 'w-4 h-4 text-text-tertiary' />
92
+ < span className = 'grow text-text-secondary system-sm-regular text-left' > { t ( 'appAnnotation.table.header.bulkExport' ) } </ span >
93
+ < ChevronRight className = 'shrink-0 w-[14px] h-[14px] text-text-tertiary ' />
94
94
</ Menu . Button >
95
95
< Transition
96
96
as = { Fragment }
@@ -103,11 +103,7 @@ const HeaderOptions: FC<Props> = ({
103
103
>
104
104
< Menu . Items
105
105
className = { cn (
106
- `
107
- absolute top-[1px] py-1 min-w-[100px] z-10 bg-white border-[0.5px] border-gray-200
108
- divide-y divide-gray-100 origin-top-right rounded-xl
109
- ` ,
110
- s . popup ,
106
+ 'absolute top-[1px] left-1 -translate-x-full py-1 min-w-[100px] z-10 bg-components-panel-bg border-[0.5px] border-components-panel-on-panel-item-bg origin-top-right rounded-xl shadow-xs' ,
111
107
) }
112
108
>
113
109
< CSVDownloader
@@ -119,12 +115,12 @@ const HeaderOptions: FC<Props> = ({
119
115
...list . map ( item => [ item . question , item . answer ] ) ,
120
116
] }
121
117
>
122
- < button disabled = { annotationUnavailable } className = { s . actionItem } >
123
- < span className = { s . actionName } > CSV</ span >
118
+ < button disabled = { annotationUnavailable } className = 'h-9 py-2 px-3 mx-1 flex items-center space-x-2 hover:bg-components-panel-on-panel-item-bg-hover rounded-lg cursor-pointer disabled:opacity-50 w-[calc(100%_-_8px)]' >
119
+ < span className = 'grow text-text-secondary system-sm-regular text-left' > CSV</ span >
124
120
</ button >
125
121
</ CSVDownloader >
126
- < button disabled = { annotationUnavailable } className = { cn ( s . actionItem , '!border-0' ) } onClick = { JSONLOutput } >
127
- < span className = { s . actionName } > JSONL</ span >
122
+ < button disabled = { annotationUnavailable } className = { cn ( 'h-9 py-2 px-3 mx-1 flex items-center space-x-2 hover:bg-components-panel-on-panel-item-bg-hover rounded-lg cursor-pointer disabled:opacity-50 w-[calc(100%_-_8px)]' , '!border-0' ) } onClick = { JSONLOutput } >
123
+ < span className = 'grow text-text-secondary system-sm-regular text-left' > JSONL</ span >
128
124
</ button >
129
125
</ Menu . Items >
130
126
</ Transition >
@@ -137,21 +133,20 @@ const HeaderOptions: FC<Props> = ({
137
133
138
134
return (
139
135
< div className = 'flex space-x-2' >
140
- < Button variant = 'primary' onClick = { ( ) => setShowAddModal ( true ) } className = 'flex items-center !h-8 !px-3 !text-[13px] space-x-2' >
141
- < RiAddLine className = 'w-4 h-4' />
136
+ < Button variant = 'primary' onClick = { ( ) => setShowAddModal ( true ) } >
137
+ < RiAddLine className = 'w-4 h-4 mr-0.5 ' />
142
138
< div > { t ( 'appAnnotation.table.header.addAnnotation' ) } </ div >
143
139
</ Button >
144
140
< CustomPopover
145
141
htmlContent = { < Operations /> }
146
142
position = "br"
147
143
trigger = "click"
148
- btnElement = { < div className = { cn ( s . actionIcon , s . commonIcon ) } /> }
149
- btnClassName = { open =>
150
- cn (
151
- open ? 'border-gray-300 !bg-gray-100 !shadow-none' : 'border-gray-200' ,
152
- s . actionIconWrapper ,
153
- )
144
+ btnElement = {
145
+ < Button variant = 'secondary' className = 'w-8 p-0' >
146
+ < RiMoreFill className = 'w-4 h-4' />
147
+ </ Button >
154
148
}
149
+ btnClassName = 'p-0 border-0'
155
150
className = { '!w-[155px] h-fit !z-20' }
156
151
popupClassName = '!w-full !overflow-visible'
157
152
manualClose
0 commit comments