2025-05-13 11:07:31 +08:00
|
|
|
import type { ChunkingMode } from '@/models/datasets'
|
|
|
|
import React from 'react'
|
|
|
|
import { useChunkStructure } from './hooks'
|
|
|
|
import OptionCard from '../option-card'
|
|
|
|
|
|
|
|
type ChunkStructureProps = {
|
|
|
|
chunkStructure: ChunkingMode
|
|
|
|
}
|
|
|
|
|
|
|
|
const ChunkStructure = ({
|
|
|
|
chunkStructure,
|
|
|
|
}: ChunkStructureProps) => {
|
|
|
|
const {
|
|
|
|
options,
|
|
|
|
} = useChunkStructure()
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div className='flex flex-col gap-y-1'>
|
|
|
|
{
|
|
|
|
options.map(option => (
|
|
|
|
<OptionCard
|
|
|
|
key={option.id}
|
|
|
|
id={option.id}
|
|
|
|
icon={option.icon}
|
2025-05-13 15:35:21 +08:00
|
|
|
iconActiveColor={option.iconActiveColor}
|
2025-05-13 11:07:31 +08:00
|
|
|
title={option.title}
|
|
|
|
description={option.description}
|
2025-05-13 15:35:21 +08:00
|
|
|
isActive={chunkStructure === option.id}
|
2025-05-13 11:07:31 +08:00
|
|
|
effectColor={option.effectColor}
|
|
|
|
showEffectColor
|
|
|
|
className='gap-x-1.5 p-3 pr-4'
|
2025-06-10 10:43:40 +08:00
|
|
|
disabled
|
2025-05-13 11:07:31 +08:00
|
|
|
/>
|
|
|
|
))
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default React.memo(ChunkStructure)
|