Faisal Amir 539b467141
ui: interface revamp (#429)
* feat: adding create bot functionality

Signed-off-by: James <james@jan.ai>

* update the temperature progress bar

Signed-off-by: James <james@jan.ai>

* WIP baselayout

* Mapping plugins with available preferences

* Added loader component

* WIP working another screen

* Cleanup types and avoid import one by one

* Prepare bottom bar

* Add css variables colors to enable user select the accent

* Enable change accent color

* Seperate css variable

* Fix conflict

* Add blank state of my model empty

* Restyle explore models page

* Enable user config left sidebar

* Restyle my models page

* WIP styling chat page

* Restyling chat message

* Fix conflict

* Adde form preferences setting plugins

* Fixed form bot info

* Sidebar bot chat

* Showing rightbar for both setting when user created bot

* Fix style bot info

* Using overflow auto intead of scroll

* Remove script built UI from root package

* Fix missig import

* Resolve error linter

* fix e2e tests

Signed-off-by: James <james@jan.ai>

---------

Signed-off-by: James <james@jan.ai>
Co-authored-by: James <james@jan.ai>
2023-10-24 10:59:12 +07:00

44 lines
1.3 KiB
TypeScript

import React from 'react'
import Image from 'next/image'
import useCreateConversation from '@hooks/useCreateConversation'
import { PlayIcon } from '@heroicons/react/24/outline'
type Props = {
model: AssistantModel
}
const ConversationalCard: React.FC<Props> = ({ model }) => {
const { requestCreateConvo } = useCreateConversation()
const { name, avatarUrl, shortDescription } = model
return (
<button
onClick={() => requestCreateConvo(model)}
className="flex w-52 flex-shrink-0 flex-col justify-between gap-3 rounded-lg bg-white p-4 text-left hover:opacity-20 dark:bg-gray-700"
>
<div className="box-border flex flex-col gap-2">
<Image
width={32}
height={32}
src={avatarUrl ?? ''}
className="rounded-full"
alt=""
/>
<h2 className="mt-2 line-clamp-1 font-semibold text-gray-900 dark:text-white">
{name}
</h2>
<span className="mt-1 line-clamp-2 font-normal text-gray-600">
{shortDescription}
</span>
</div>
<span className="flex items-center gap-0.5 text-xs leading-5 text-gray-500">
<PlayIcon width={16} height={16} />
32.2k runs
</span>
</button>
)
}
export default React.memo(ConversationalCard)