mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-07-31 07:32:01 +08:00
### What problem does this PR solve? Feat: Alter Item to TransferListItemType #3221 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
parent
6e13922bdc
commit
80389ae61e
@ -10,15 +10,19 @@ import {
|
||||
} from 'lucide-react';
|
||||
import React from 'react';
|
||||
|
||||
type Item = {
|
||||
export type TransferListItemType = {
|
||||
key: string;
|
||||
label: string;
|
||||
selected?: boolean;
|
||||
};
|
||||
|
||||
export default function TransferList({ items }: { items: Item[] }) {
|
||||
const [leftList, setLeftList] = React.useState<Item[]>(items);
|
||||
const [rightList, setRightList] = React.useState<Item[]>([]);
|
||||
export default function TransferList({
|
||||
items,
|
||||
}: {
|
||||
items: TransferListItemType[];
|
||||
}) {
|
||||
const [leftList, setLeftList] = React.useState<TransferListItemType[]>(items);
|
||||
const [rightList, setRightList] = React.useState<TransferListItemType[]>([]);
|
||||
const [leftSearch, setLeftSearch] = React.useState('');
|
||||
const [rightSearch, setRightSearch] = React.useState('');
|
||||
|
||||
@ -35,8 +39,8 @@ export default function TransferList({ items }: { items: Item[] }) {
|
||||
};
|
||||
|
||||
const toggleSelection = (
|
||||
list: Item[],
|
||||
setList: React.Dispatch<React.SetStateAction<Item[]>>,
|
||||
list: TransferListItemType[],
|
||||
setList: React.Dispatch<React.SetStateAction<TransferListItemType[]>>,
|
||||
key: string,
|
||||
) => {
|
||||
const updatedList = list.map((item) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user