33 lines
774 B
TypeScript
Raw Normal View History

2025-06-19 18:13:56 +08:00
'use client'
import type { FC } from 'react'
import React from 'react'
2025-06-23 18:09:32 +08:00
import NoPluginSelected from './no-plugin-selected'
import type { AUTO_UPDATE_MODE } from './types'
2025-06-19 18:13:56 +08:00
type Props = {
2025-06-23 18:09:32 +08:00
updateMode: AUTO_UPDATE_MODE
2025-06-19 18:13:56 +08:00
value: string[] // plugin ids
onChange: (value: string[]) => void
}
const PluginsPicker: FC<Props> = ({
2025-06-23 18:09:32 +08:00
updateMode,
2025-06-19 18:13:56 +08:00
value,
onChange,
}) => {
const hasSelected = value.length > 0
return (
2025-06-23 18:09:32 +08:00
<div className='mt-2 rounded-[10px] bg-background-section-burn p-2.5'>
2025-06-19 18:13:56 +08:00
{hasSelected ? (
<div className='flex justify-between'>
<div>Selected plugins will not auto-update</div>
</div>
) : (
2025-06-23 18:09:32 +08:00
<NoPluginSelected updateMode={updateMode} />
2025-06-19 18:13:56 +08:00
)}
2025-06-23 18:09:32 +08:00
2025-06-19 18:13:56 +08:00
</div>
)
}
export default React.memo(PluginsPicker)