parent
d1208047a5
commit
d0f8fc4e6a
7 changed files with 196 additions and 145 deletions
@ -0,0 +1,27 @@ |
||||
import { Loader2 } from 'lucide-react'; |
||||
|
||||
type AILoadingStateProps = { |
||||
title: string; |
||||
subtitle?: string; |
||||
}; |
||||
|
||||
export function AILoadingState(props: AILoadingStateProps) { |
||||
const { title, subtitle } = props; |
||||
|
||||
return ( |
||||
<div className="flex min-h-full w-full flex-col items-center justify-center gap-4 rounded-lg border border-gray-200 bg-white p-8"> |
||||
<div className="relative"> |
||||
<Loader2 className="size-12 animate-spin text-gray-300" /> |
||||
<div className="absolute inset-0 flex items-center justify-center"> |
||||
<div className="size-4 rounded-full bg-white"></div> |
||||
</div> |
||||
</div> |
||||
<div className="text-center"> |
||||
<p className="text-lg font-medium text-gray-900">{title}</p> |
||||
{subtitle && ( |
||||
<p className="mt-1 text-sm text-gray-500">{subtitle}</p> |
||||
)} |
||||
</div> |
||||
</div> |
||||
); |
||||
}
|
@ -0,0 +1,31 @@ |
||||
import { type LucideIcon } from 'lucide-react'; |
||||
|
||||
type AITutorTallMessageProps = { |
||||
title: string; |
||||
subtitle?: string; |
||||
icon: LucideIcon; |
||||
buttonText?: string; |
||||
onButtonClick?: () => void; |
||||
}; |
||||
|
||||
export function AITutorTallMessage(props: AITutorTallMessageProps) { |
||||
const { title, subtitle, icon: Icon, buttonText, onButtonClick } = props; |
||||
|
||||
return ( |
||||
<div className="flex min-h-full flex-grow flex-col items-center justify-center rounded-lg"> |
||||
<Icon className="size-12 text-gray-300" /> |
||||
<div className="my-4 text-center"> |
||||
<h2 className="mb-2 text-xl font-semibold">{title}</h2> |
||||
{subtitle && <p className="text-base text-gray-600">{subtitle}</p>} |
||||
</div> |
||||
{buttonText && onButtonClick && ( |
||||
<button |
||||
onClick={onButtonClick} |
||||
className="rounded-lg bg-black px-4 py-2 text-sm text-white hover:opacity-80" |
||||
> |
||||
{buttonText} |
||||
</button> |
||||
)} |
||||
</div> |
||||
); |
||||
} |
Loading…
Reference in new issue