feat: n to 1 retrieval legacy (#6554)

This commit is contained in:
zxhlyh
2024-07-24 12:50:48 +08:00
committed by GitHub
parent e4bb943fe5
commit 6fe9aa69cc
35 changed files with 1329 additions and 249 deletions

View File

@@ -1,7 +1,6 @@
'use client'
import type { FC } from 'react'
import React from 'react'
import s from './style.module.css'
import cn from '@/utils/classnames'
type Props = {
@@ -29,7 +28,12 @@ const RadioCard: FC<Props> = ({
chosenConfigWrapClassName,
}) => {
return (
<div className={cn(s.item, isChosen && s.active)}>
<div
className={cn(
'border border-components-option-card-option-border bg-components-option-card-option-bg rounded-xl hover:shadow-xs cursor-pointer',
isChosen && 'bg-components-option-card-option-selected-bg border-components-panel-border shadow-xs',
)}
>
<div className='flex py-3 pl-3 pr-4' onClick={onChosen}>
<div className={cn(iconBgClassName, 'mr-3 shrink-0 flex w-8 justify-center h-8 items-center rounded-lg')}>
{icon}
@@ -40,12 +44,15 @@ const RadioCard: FC<Props> = ({
</div>
{!noRadio && (
<div className='shrink-0 flex items-center h-8'>
<div className={s.radio}></div>
<div className={cn(
'w-4 h-4 border border-components-radio-border bg-components-radio-bg shadow-xs rounded-full',
isChosen && 'border-[5px] border-components-radio-border-checked',
)}></div>
</div>
)}
</div>
{((isChosen && chosenConfig) || noRadio) && (
<div className={cn(chosenConfigWrapClassName, 'pt-2 px-14 pb-6 border-t border-gray-200')}>
<div className={cn(chosenConfigWrapClassName, 'p-3 border-t border-gray-200')}>
{chosenConfig}
</div>
)}

View File

@@ -6,7 +6,7 @@ import cn from '@/utils/classnames'
type Props = {
className?: string
title: string
title: string | JSX.Element | null
description: string
isChosen: boolean
onChosen: () => void

View File

@@ -1,25 +0,0 @@
.item {
@apply relative rounded-xl border border-gray-100 cursor-pointer;
background-color: #fcfcfd;
}
.item.active {
border-width: 1.5px;
border-color: #528BFF;
box-shadow: 0px 1px 3px rgba(16, 24, 40, 0.1), 0px 1px 2px rgba(16, 24, 40, 0.06);
}
.item:hover {
background-color: #ffffff;
border-color: #B2CCFF;
box-shadow: 0px 12px 16px -4px rgba(16, 24, 40, 0.08), 0px 4px 6px -2px rgba(16, 24, 40, 0.03);
}
.radio {
@apply w-4 h-4 border-[2px] border-gray-200 rounded-full;
}
.item.active .radio {
border-width: 5px;
border-color: #155EEF;
}