* Make thread screen as default screen * Blank state when user have not any model * Cleanup topbar thread screen * Improve style right panel * Add instructions right panel * Styling thread list history * Resolve conflict * Default title new thread * Fix trigger panel sidebar * Make default right panel false when no activethread * Fix CI test * chore: assistant instruction with system prompt * Fix title and blank state explore the hub * Claenup style thread screen and add buble message for assitant * Remove unused import * Styling more menus on thread list and right panel, and make max height textarea 400 pixel * Finished revamp ui thread * Finished system monitor UI * Style box running models * Make animate right panel more smooth * Add status arround textarea for starting model info * Temporary disable hide left panel * chore: system resource monitoring update * copy nits * chore: typo * Reverse icon chevron accordion * Move my models into setting page --------- Co-authored-by: Louis <louis@jan.ai> Co-authored-by: 0xSage <n@pragmatic.vc>
53 lines
1.4 KiB
TypeScript
53 lines
1.4 KiB
TypeScript
import toast from 'react-hot-toast'
|
|
|
|
import { XIcon } from 'lucide-react'
|
|
import { twMerge } from 'tailwind-merge'
|
|
|
|
type Props = {
|
|
title?: string
|
|
description?: string
|
|
type?: 'default' | 'error' | 'success'
|
|
}
|
|
|
|
export function toaster(props: Props) {
|
|
const { title, description, type = 'default' } = props
|
|
return toast.custom(
|
|
(t) => {
|
|
return (
|
|
<div
|
|
className={twMerge(
|
|
'unset-drag relative flex min-w-[200px] max-w-[350px] gap-x-4 rounded-lg border border-border bg-background px-4 py-3',
|
|
t.visible ? 'animate-enter' : 'animate-leave',
|
|
type === 'success' && 'bg-primary text-primary-foreground'
|
|
)}
|
|
>
|
|
<div>
|
|
<h1
|
|
className={twMerge(
|
|
'font-medium',
|
|
type === 'success' && 'font-medium text-primary-foreground'
|
|
)}
|
|
>
|
|
{title}
|
|
</h1>
|
|
<p
|
|
className={twMerge(
|
|
'mt-1 text-muted-foreground',
|
|
type === 'success' && 'text-primary-foreground/80'
|
|
)}
|
|
>
|
|
{description}
|
|
</p>
|
|
</div>
|
|
<XIcon
|
|
size={24}
|
|
className="absolute right-2 top-2 w-4 cursor-pointer text-muted-foreground"
|
|
onClick={() => toast.dismiss(t.id)}
|
|
/>
|
|
</div>
|
|
)
|
|
},
|
|
{ id: 'toast', duration: 3000 }
|
|
)
|
|
}
|