From d454214ddc3e1ce39bd988c327418947fbfc807e Mon Sep 17 00:00:00 2001 From: Joel Date: Wed, 2 Jul 2025 16:18:44 +0800 Subject: [PATCH] fix: table placeholder --- .../apps/check-legacy/components/list.tsx | 29 +++++++-- .../(commonLayout)/apps/check-legacy/page.tsx | 62 +++++++++++-------- .../apps/check-legacy/use-legacy-list.ts | 2 + 3 files changed, 61 insertions(+), 32 deletions(-) diff --git a/web/app/(commonLayout)/apps/check-legacy/components/list.tsx b/web/app/(commonLayout)/apps/check-legacy/components/list.tsx index 149f8b30d4..d464c4e76f 100644 --- a/web/app/(commonLayout)/apps/check-legacy/components/list.tsx +++ b/web/app/(commonLayout)/apps/check-legacy/components/list.tsx @@ -1,6 +1,8 @@ 'use client' import type { FC } from 'react' import React from 'react' +import { useTranslation } from 'react-i18next' +import cn from '@/utils/classnames' type Props = { list: any[] @@ -9,16 +11,33 @@ type Props = { const List: FC = ({ list, }) => { + const { t } = useTranslation() return (
{list.length > 0 ? ( -
    + + + + + + + + + + + {list.map((item, index) => ( -
  • - {item} -
  • + + + + + + + ))} - +
    xxx{t('appLog.table.header.endUser')}{t('appLog.table.header.userRate')}{t('appLog.table.header.time')}{t('appLog.table.header.time')}
    + Python bug fixer + YesEvan ยท evan@dify.ai2023-03-21 10:252023-03-21 10:25
    ) : (
    No items found
    )} diff --git a/web/app/(commonLayout)/apps/check-legacy/page.tsx b/web/app/(commonLayout)/apps/check-legacy/page.tsx index a110c877f1..73f23084ec 100644 --- a/web/app/(commonLayout)/apps/check-legacy/page.tsx +++ b/web/app/(commonLayout)/apps/check-legacy/page.tsx @@ -4,14 +4,16 @@ import Header from './components/header' import List from './components/list' import useLegacyList from './use-legacy-list' import Chip from '@/app/components/base/chip' -import { RiFilter3Line } from '@remixicon/react' +import { RiFilter3Line, RiLoopLeftLine } from '@remixicon/react' import { useCallback } from 'react' import { useTranslation } from 'react-i18next' +import Button from '@/app/components/base/button' const i18nPrefix = 'app.checkLegacy' const Page = () => { const { t } = useTranslation() const { + list, sort_by, setOrderBy, published, @@ -38,34 +40,40 @@ const Page = () => {
    {/* Filter */} -
    - } - value={published} - renderTriggerContent={renderTriggerContent} - onSelect={handleSelectPublished} - onClear={clearPublished} - items={[ - { value: 1, name: t(`${i18nPrefix}.yes`) }, - { value: 0, name: t(`${i18nPrefix}.no`) }, - ]} - /> -
    - +
    +
    + } + value={published} + renderTriggerContent={renderTriggerContent} + onSelect={handleSelectPublished} + onClear={clearPublished} + items={[ + { value: 1, name: t(`${i18nPrefix}.yes`) }, + { value: 0, name: t(`${i18nPrefix}.no`) }, + ]} + /> +
    + +
    +
    - +
    ) diff --git a/web/app/(commonLayout)/apps/check-legacy/use-legacy-list.ts b/web/app/(commonLayout)/apps/check-legacy/use-legacy-list.ts index dcc5e133d9..3bd50d2166 100644 --- a/web/app/(commonLayout)/apps/check-legacy/use-legacy-list.ts +++ b/web/app/(commonLayout)/apps/check-legacy/use-legacy-list.ts @@ -2,6 +2,7 @@ import produce from 'immer' import { useCallback, useState } from 'react' const useLegacyList = () => { + const list: any[] = [{}, {}, {}] // Placeholder for the list, replace with actual data fetching logic const [queryParams, setQueryParams] = useState>({}) const { sort_by, @@ -29,6 +30,7 @@ const useLegacyList = () => { }, [queryParams]) return { + list, sort_by, setOrderBy, published,