chore: format all frontend files (#430)

This commit is contained in:
tecvan
2025-07-31 23:15:48 +08:00
committed by GitHub
parent 8b078ff013
commit 6995cec404
8787 changed files with 11975 additions and 10924 deletions

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { useState } from 'react';
import classNames from 'classnames';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type FC, type PropsWithChildren } from 'react';
import { I18n } from '@coze-arch/i18n';

View File

@@ -13,5 +13,5 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { FilePopover } from './file-popover';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export {
KnowledgeCardListVertical,
type DatasetCardListVerticalOperations,

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type FC } from 'react';
import { unix } from 'dayjs';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import copy from 'copy-to-clipboard';
import { useDataNavigate } from '@coze-data/knowledge-stores';
import { REPORT_EVENTS as ReportEventNames } from '@coze-arch/report-events';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import classNames from 'classnames';
import { IconCozKnowledgeFill } from '@coze-arch/coze-design/icons';

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import type { FC, ReactNode } from 'react';
import classNames from 'classnames';

View File

@@ -353,96 +353,99 @@ const useKnowledgeFilter = ({
};
const renderSearch = useMemo(
() => () => (
<Input
autoFocus
key="query-input"
placeholder={I18n.t('db2_014')}
onChange={debounce(handleQueryChange, 500)}
/>
),
() => () =>
(
<Input
autoFocus
key="query-input"
placeholder={I18n.t('db2_014')}
onChange={debounce(handleQueryChange, 500)}
/>
),
[],
);
const renderCreateBtn = useMemo(
() => () => (
<UIButton
theme="solid"
onClick={handleAdd}
data-testid={BotE2e.BotKnowledgeSelectListModalCreateBtn}
>
{I18n.t('datasets_create_btn')}
</UIButton>
),
() => () =>
(
<UIButton
theme="solid"
onClick={handleAdd}
data-testid={BotE2e.BotKnowledgeSelectListModalCreateBtn}
>
{I18n.t('datasets_create_btn')}
</UIButton>
),
[handleAdd],
);
const renderFilters = useMemo(
() => () => (
<>
<div className={styles['file-type-tab']}>
{uniqKnowledgeTypeConfigList.reduce<ReactNode[]>(
(
accumulator: ReactNode[],
currentValue: FilterKnowledgeType,
currentIndex: number,
) => {
const reactNode = renderKnowledgeTypeConfigNode(currentValue);
if (currentIndex !== 0) {
return accumulator.concat([
<Divider layout="vertical" margin="12px" />,
reactNode,
]);
}
return accumulator.concat([reactNode]);
},
[],
)}
</div>
() => () =>
(
<>
<div className={styles['file-type-tab']}>
{uniqKnowledgeTypeConfigList.reduce<ReactNode[]>(
(
accumulator: ReactNode[],
currentValue: FilterKnowledgeType,
currentIndex: number,
) => {
const reactNode = renderKnowledgeTypeConfigNode(currentValue);
if (currentIndex !== 0) {
return accumulator.concat([
<Divider layout="vertical" margin="12px" />,
reactNode,
]);
}
return accumulator.concat([reactNode]);
},
[],
)}
</div>
<div className={'flex'}>
{uniq(showFilters).map((filterType: DatasetFilterType) => {
if (filterType === 'scope-type') {
return !isPersonal ? (
<UISelect
label={I18n.t('Creator')}
showClear={false}
value={scopeType}
optionList={scopeOptions}
onChange={v => {
setScopeType(v as DatasetScopeType);
}}
/>
) : null;
} else if (filterType === 'search-type') {
return (
<UISelect
data-testid={
BotE2e.BotKnowledgeSelectListModalCreateDateSelect
}
label={I18n.t('Sort')}
showClear={false}
value={searchType}
optionList={[
{
label: I18n.t('Create_time'),
value: OrderField.CreateTime,
},
{
label: I18n.t('Update_time'),
value: OrderField.UpdateTime,
},
]}
onChange={v => {
handleSearchTypeChange(v as OrderField);
}}
/>
);
}
})}
</div>
</>
),
<div className={'flex'}>
{uniq(showFilters).map((filterType: DatasetFilterType) => {
if (filterType === 'scope-type') {
return !isPersonal ? (
<UISelect
label={I18n.t('Creator')}
showClear={false}
value={scopeType}
optionList={scopeOptions}
onChange={v => {
setScopeType(v as DatasetScopeType);
}}
/>
) : null;
} else if (filterType === 'search-type') {
return (
<UISelect
data-testid={
BotE2e.BotKnowledgeSelectListModalCreateDateSelect
}
label={I18n.t('Sort')}
showClear={false}
value={searchType}
optionList={[
{
label: I18n.t('Create_time'),
value: OrderField.CreateTime,
},
{
label: I18n.t('Update_time'),
value: OrderField.UpdateTime,
},
]}
onChange={v => {
handleSearchTypeChange(v as OrderField);
}}
/>
);
}
})}
</div>
</>
),
[
headerClassName,
handleSearchTypeChange,