mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-01 23:56:39 +08:00
暂存
This commit is contained in:
parent
cb62fa7634
commit
ebbf9e4f7c
@ -78,6 +78,7 @@ import {
|
||||
List,
|
||||
ListItem,
|
||||
Modal,
|
||||
ModalSelector,
|
||||
Selector,
|
||||
showConfirm,
|
||||
showPrompt,
|
||||
@ -606,7 +607,7 @@ export function ChatActions(props: {
|
||||
{/*/>*/}
|
||||
|
||||
{showModelSelector && (
|
||||
<Selector
|
||||
<ModalSelector
|
||||
defaultSelectedValue={currentModel}
|
||||
items={models.map((m) => ({
|
||||
title: m.displayName,
|
||||
|
@ -15,6 +15,7 @@ import Locale from "../locales";
|
||||
import { createRoot } from "react-dom/client";
|
||||
import React, { HTMLProps, useEffect, useState } from "react";
|
||||
import { IconButton } from "./button";
|
||||
import { Card as AntCard, List as AntList, Row, Col, Grid } from "antd";
|
||||
|
||||
export function Popover(props: {
|
||||
children: JSX.Element;
|
||||
@ -485,3 +486,35 @@ export function Selector<T>(props: {
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export function ModalSelector<T>(props: {
|
||||
items: Array<{
|
||||
title: string;
|
||||
subTitle?: string;
|
||||
value: T;
|
||||
}>;
|
||||
defaultSelectedValue?: T;
|
||||
onSelection?: (selection: T[]) => void;
|
||||
onClose?: () => void;
|
||||
multiple?: boolean;
|
||||
}) {
|
||||
console.log("-----", props);
|
||||
|
||||
return (
|
||||
<div className={styles["selector"]}>
|
||||
<Modal title="test" onClose={() => props.onClose?.()}>
|
||||
<AntList grid={{ gutter: 16, column: 4 }}>
|
||||
<Col span={8}>
|
||||
<AntList.Item>
|
||||
<AntCard title="你好">Card</AntCard>
|
||||
</AntList.Item>
|
||||
</Col>
|
||||
|
||||
<AntList.Item>
|
||||
<AntCard title="你好">Card</AntCard>
|
||||
</AntList.Item>
|
||||
</AntList>
|
||||
</Modal>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user