datasource page
parent
18b1a9cb2e
commit
8f2ad89027
@ -0,0 +1,45 @@
|
||||
import { RiAddLine } from '@remixicon/react'
|
||||
import Item from './item'
|
||||
import Button from '@/app/components/base/button'
|
||||
|
||||
const Card = () => {
|
||||
return (
|
||||
<div className='rounded-xl bg-background-section-burn'>
|
||||
<div className='flex items-center p-3 pb-2'>
|
||||
<div className='shrinkj-0 mr-3 flex h-10 w-10 items-center justify-center'></div>
|
||||
<div className='grow'>
|
||||
<div className='system-md-semibold text-text-primary'>
|
||||
Notion Data Source
|
||||
</div>
|
||||
<div className='system-xs-regular flex h-4 items-center text-text-tertiary'>
|
||||
langgenius
|
||||
<div className='text-text-quaternary'>/</div>
|
||||
notion-data-source
|
||||
</div>
|
||||
</div>
|
||||
<Button
|
||||
variant='secondary-accent'
|
||||
>
|
||||
<RiAddLine className='h-4 w-4' />
|
||||
Configure
|
||||
</Button>
|
||||
</div>
|
||||
<div className='system-xs-medium flex h-4 items-center pl-3 text-text-tertiary'>
|
||||
Connected workspace
|
||||
<div className='ml-3 h-[1px] grow bg-divider-subtle'></div>
|
||||
</div>
|
||||
<div className='space-y-1 p-3 pt-2'>
|
||||
<Item />
|
||||
<Item />
|
||||
<Item />
|
||||
</div>
|
||||
<div className='p-3 pt-1'>
|
||||
<div className='system-xs-regular flex h-10 items-center justify-center rounded-[10px] bg-background-section text-text-tertiary'>
|
||||
Please configure authentication
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default Card
|
||||
@ -0,0 +1,12 @@
|
||||
import Card from './card'
|
||||
|
||||
const DataSourcePage = () => {
|
||||
return (
|
||||
<div className='space-y-2'>
|
||||
<Card />
|
||||
<Card />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default DataSourcePage
|
||||
@ -0,0 +1,73 @@
|
||||
import {
|
||||
useCallback,
|
||||
useMemo,
|
||||
} from 'react'
|
||||
import {
|
||||
RiDeleteBinLine,
|
||||
RiLoopLeftLine,
|
||||
RiStickyNoteAddLine,
|
||||
} from '@remixicon/react'
|
||||
import Dropdown from '@/app/components/base/dropdown'
|
||||
import type { Item } from '@/app/components/base/dropdown'
|
||||
|
||||
const Operator = () => {
|
||||
const items = useMemo(() => {
|
||||
return [
|
||||
{
|
||||
value: 'change',
|
||||
text: (
|
||||
<div className='flex'>
|
||||
<RiStickyNoteAddLine className='mr-2 h-4 w-4 text-text-tertiary' />
|
||||
<div>
|
||||
<div className='system-sm-semibold mb-1 text-text-secondary'>Change authorized pages</div>
|
||||
<div className='system-xs-regular text-text-tertiary'>18 Pages authorized</div>
|
||||
</div>
|
||||
</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
value: 'sync',
|
||||
text: (
|
||||
<div className='flex items-center'>
|
||||
<RiLoopLeftLine className='mr-2 h-4 w-4 text-text-tertiary' />
|
||||
<div className='system-sm-semibold text-text-secondary'>Sync</div>
|
||||
</div>
|
||||
),
|
||||
},
|
||||
]
|
||||
}, [])
|
||||
|
||||
const secondItems = useMemo(() => {
|
||||
return [
|
||||
{
|
||||
value: 'delete',
|
||||
text: (
|
||||
<div className='flex items-center'>
|
||||
<RiDeleteBinLine className='mr-2 h-4 w-4 text-text-tertiary' />
|
||||
<div className='system-sm-semibold text-text-secondary'>Remove</div>
|
||||
</div>
|
||||
),
|
||||
},
|
||||
]
|
||||
}, [])
|
||||
|
||||
const handleSelect = useCallback((item: Item) => {
|
||||
console.log('Selected item:', item)
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<Dropdown
|
||||
items={items}
|
||||
secondItems={secondItems}
|
||||
onSelect={handleSelect}
|
||||
popupClassName='z-[61]'
|
||||
triggerProps={{
|
||||
size: 'l',
|
||||
}}
|
||||
itemClassName='py-2 h-auto hover:bg-state-base-hover'
|
||||
secondItemClassName='py-2 h-auto hover:bg-state-base-hover'
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
export default Operator
|
||||
Loading…
Reference in New Issue