mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-02 16:16:39 +08:00
暂存
This commit is contained in:
parent
cb62fa7634
commit
ebbf9e4f7c
@ -78,6 +78,7 @@ import {
|
|||||||
List,
|
List,
|
||||||
ListItem,
|
ListItem,
|
||||||
Modal,
|
Modal,
|
||||||
|
ModalSelector,
|
||||||
Selector,
|
Selector,
|
||||||
showConfirm,
|
showConfirm,
|
||||||
showPrompt,
|
showPrompt,
|
||||||
@ -606,7 +607,7 @@ export function ChatActions(props: {
|
|||||||
{/*/>*/}
|
{/*/>*/}
|
||||||
|
|
||||||
{showModelSelector && (
|
{showModelSelector && (
|
||||||
<Selector
|
<ModalSelector
|
||||||
defaultSelectedValue={currentModel}
|
defaultSelectedValue={currentModel}
|
||||||
items={models.map((m) => ({
|
items={models.map((m) => ({
|
||||||
title: m.displayName,
|
title: m.displayName,
|
||||||
|
@ -15,6 +15,7 @@ import Locale from "../locales";
|
|||||||
import { createRoot } from "react-dom/client";
|
import { createRoot } from "react-dom/client";
|
||||||
import React, { HTMLProps, useEffect, useState } from "react";
|
import React, { HTMLProps, useEffect, useState } from "react";
|
||||||
import { IconButton } from "./button";
|
import { IconButton } from "./button";
|
||||||
|
import { Card as AntCard, List as AntList, Row, Col, Grid } from "antd";
|
||||||
|
|
||||||
export function Popover(props: {
|
export function Popover(props: {
|
||||||
children: JSX.Element;
|
children: JSX.Element;
|
||||||
@ -485,3 +486,35 @@ export function Selector<T>(props: {
|
|||||||
</div>
|
</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