Skip to content

Commit

Permalink
feat(ui): conversation settings button
Browse files Browse the repository at this point in the history
  • Loading branch information
ddiu8081 committed May 5, 2023
1 parent 4cf428b commit ec3d65d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/components/main/ConversationEmpty.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
import { showConversationEditModal } from '@/stores/ui'
import ConversationEdit from '../conversations/ConversationEdit'
import { getBotMetaById } from '@/stores/provider'
import type { Conversation } from '@/types/conversation'

interface Props {
conversation: Conversation
}

export default (props: Props) => {
const botMeta = () => getBotMetaById(props.conversation.bot) || null
return (
<div class="h-full py-16 overflow-auto px-12 sm:px-18">
<div class="max-w-xl mx-auto">
<div onClick={() => showConversationEditModal.set(true)}>open settings</div>
<div class="fi flex-col h-full py-4 overflow-auto px-6">
<div
class="inline-flex items-center gap-1 button"
onClick={() => showConversationEditModal.set(true)}
>
<div i-carbon-settings-adjust />
{botMeta().provider.name} / {botMeta().label}
{props.conversation.systemInfo && (
<div class="text-xs px-1 border border-darker rounded-md op-40">System Info</div>
)}
</div>
</div>
)
Expand Down
3 changes: 3 additions & 0 deletions unocss.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export default defineConfig({
'hv-base': 'transition-colors cursor-pointer hover:bg-darker',
'hv-foreground': 'transition-opacity cursor-pointer op-70 hover:op-100',
'input-base': 'bg-transparent placeholder:op-50 dark:placeholder:op-20 focus:(ring-0 outline-none) resize-none',
'button': 'mt-4 px-3 py-2 text-xs border border-base rounded-lg hv-base hover:border-darker',
'max-w-base': 'max-w-3xl mx-auto',
'text-error': 'text-red-700 dark:text-red-400/80',
'border-error': 'border border-red-700 dark:border-red-400/80',
Expand All @@ -67,6 +68,8 @@ export default defineConfig({
'fi': 'flex items-center',
'fcc': 'fc items-center',
'fb': 'flex justify-between',

// TODO: remove below
'fie': 'fi justify-end',
'col-fcc': 'flex-col fcc',
'inline-fcc': 'inline-flex items-center justify-center',
Expand Down

0 comments on commit ec3d65d

Please sign in to comment.