mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-03 04:42:39 +02:00
refactor: enhance UI components for consistency and user experience
- Updated various card components across Google Drive, Linear, and Notion tools to include the `select-none` class for improved user interaction by preventing text selection. - Ensured consistent styling and behavior in loading states and error handling across different tool UIs, enhancing overall usability and visual coherence.
This commit is contained in:
parent
8850fac722
commit
151dcd26e1
8 changed files with 46 additions and 46 deletions
|
|
@ -515,7 +515,7 @@ function ApprovalCard({
|
|||
|
||||
function AuthErrorCard({ result }: { result: AuthErrorResult }) {
|
||||
return (
|
||||
<div className="my-4 max-w-lg overflow-hidden rounded-2xl border bg-muted/30">
|
||||
<div className="my-4 max-w-lg overflow-hidden rounded-2xl border bg-muted/30 select-none">
|
||||
<div className="px-5 pt-5 pb-4">
|
||||
<p className="text-sm font-semibold text-destructive">
|
||||
All Linear accounts expired
|
||||
|
|
@ -531,7 +531,7 @@ function AuthErrorCard({ result }: { result: AuthErrorResult }) {
|
|||
|
||||
function ErrorCard({ result }: { result: ErrorResult }) {
|
||||
return (
|
||||
<div className="my-4 max-w-lg overflow-hidden rounded-2xl border bg-muted/30">
|
||||
<div className="my-4 max-w-lg overflow-hidden rounded-2xl border bg-muted/30 select-none">
|
||||
<div className="px-5 pt-5 pb-4">
|
||||
<p className="text-sm font-semibold text-destructive">Failed to create Linear issue</p>
|
||||
</div>
|
||||
|
|
@ -545,7 +545,7 @@ function ErrorCard({ result }: { result: ErrorResult }) {
|
|||
|
||||
function SuccessCard({ result }: { result: SuccessResult }) {
|
||||
return (
|
||||
<div className="my-4 max-w-lg overflow-hidden rounded-2xl border bg-muted/30">
|
||||
<div className="my-4 max-w-lg overflow-hidden rounded-2xl border bg-muted/30 select-none">
|
||||
<div className="px-5 pt-5 pb-4">
|
||||
<p className="text-sm font-semibold text-foreground">
|
||||
{result.message || "Linear issue created successfully"}
|
||||
|
|
@ -582,9 +582,9 @@ export const CreateLinearIssueToolUI = makeAssistantToolUI<
|
|||
render: function CreateLinearIssueUI({ args, result, status }) {
|
||||
if (status.type === "running") {
|
||||
return (
|
||||
<div className="my-4 max-w-lg rounded-2xl border bg-muted/30 px-5 py-4">
|
||||
<TextShimmerLoader text="Preparing Linear issue..." size="sm" />
|
||||
</div>
|
||||
<div className="my-4 max-w-lg rounded-2xl border bg-muted/30 px-5 py-4 select-none">
|
||||
<TextShimmerLoader text="Preparing Linear issue..." size="sm" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -282,7 +282,7 @@ function ApprovalCard({
|
|||
|
||||
function AuthErrorCard({ result }: { result: AuthErrorResult }) {
|
||||
return (
|
||||
<div className="my-4 max-w-lg overflow-hidden rounded-2xl border bg-muted/30">
|
||||
<div className="my-4 max-w-lg overflow-hidden rounded-2xl border bg-muted/30 select-none">
|
||||
<div className="px-5 pt-5 pb-4">
|
||||
<p className="text-sm font-semibold text-destructive">
|
||||
Linear authentication expired
|
||||
|
|
@ -298,7 +298,7 @@ function AuthErrorCard({ result }: { result: AuthErrorResult }) {
|
|||
|
||||
function ErrorCard({ result }: { result: ErrorResult }) {
|
||||
return (
|
||||
<div className="my-4 max-w-lg overflow-hidden rounded-2xl border bg-muted/30">
|
||||
<div className="my-4 max-w-lg overflow-hidden rounded-2xl border bg-muted/30 select-none">
|
||||
<div className="px-5 pt-5 pb-4">
|
||||
<p className="text-sm font-semibold text-destructive">Failed to delete Linear issue</p>
|
||||
</div>
|
||||
|
|
@ -312,7 +312,7 @@ function ErrorCard({ result }: { result: ErrorResult }) {
|
|||
|
||||
function NotFoundCard({ result }: { result: NotFoundResult }) {
|
||||
return (
|
||||
<div className="my-4 max-w-lg overflow-hidden rounded-2xl border bg-muted/30">
|
||||
<div className="my-4 max-w-lg overflow-hidden rounded-2xl border bg-muted/30 select-none">
|
||||
<div className="px-5 pt-5 pb-4">
|
||||
<p className="text-sm font-semibold text-amber-600 dark:text-amber-400">
|
||||
Issue not found
|
||||
|
|
@ -328,7 +328,7 @@ function NotFoundCard({ result }: { result: NotFoundResult }) {
|
|||
|
||||
function WarningCard({ result }: { result: WarningResult }) {
|
||||
return (
|
||||
<div className="my-4 max-w-lg overflow-hidden rounded-2xl border bg-muted/30">
|
||||
<div className="my-4 max-w-lg overflow-hidden rounded-2xl border bg-muted/30 select-none">
|
||||
<div className="flex items-start gap-3 border-b px-5 py-4">
|
||||
<TriangleAlertIcon className="size-4 mt-0.5 shrink-0 text-amber-500" />
|
||||
<p className="text-sm font-medium text-amber-600 dark:text-amber-500">Partial success</p>
|
||||
|
|
@ -342,7 +342,7 @@ function WarningCard({ result }: { result: WarningResult }) {
|
|||
|
||||
function SuccessCard({ result }: { result: SuccessResult }) {
|
||||
return (
|
||||
<div className="my-4 max-w-lg overflow-hidden rounded-2xl border bg-muted/30">
|
||||
<div className="my-4 max-w-lg overflow-hidden rounded-2xl border bg-muted/30 select-none">
|
||||
<div className="px-5 pt-5 pb-4">
|
||||
<p className="text-sm font-semibold text-foreground">
|
||||
{result.message || "Linear issue archived successfully"}
|
||||
|
|
@ -370,9 +370,9 @@ export const DeleteLinearIssueToolUI = makeAssistantToolUI<
|
|||
render: function DeleteLinearIssueUI({ result, status }) {
|
||||
if (status.type === "running") {
|
||||
return (
|
||||
<div className="my-4 max-w-lg rounded-2xl border bg-muted/30 px-5 py-4">
|
||||
<TextShimmerLoader text="Preparing Linear issue deletion..." size="sm" />
|
||||
</div>
|
||||
<div className="my-4 max-w-lg rounded-2xl border bg-muted/30 px-5 py-4 select-none">
|
||||
<TextShimmerLoader text="Preparing Linear issue deletion..." size="sm" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -630,7 +630,7 @@ function ApprovalCard({
|
|||
|
||||
function AuthErrorCard({ result }: { result: AuthErrorResult }) {
|
||||
return (
|
||||
<div className="my-4 max-w-lg overflow-hidden rounded-2xl border bg-muted/30">
|
||||
<div className="my-4 max-w-lg overflow-hidden rounded-2xl border bg-muted/30 select-none">
|
||||
<div className="px-5 pt-5 pb-4">
|
||||
<p className="text-sm font-semibold text-destructive">
|
||||
Linear authentication expired
|
||||
|
|
@ -646,7 +646,7 @@ function AuthErrorCard({ result }: { result: AuthErrorResult }) {
|
|||
|
||||
function ErrorCard({ result }: { result: ErrorResult }) {
|
||||
return (
|
||||
<div className="my-4 max-w-lg overflow-hidden rounded-2xl border bg-muted/30">
|
||||
<div className="my-4 max-w-lg overflow-hidden rounded-2xl border bg-muted/30 select-none">
|
||||
<div className="px-5 pt-5 pb-4">
|
||||
<p className="text-sm font-semibold text-destructive">Failed to update Linear issue</p>
|
||||
</div>
|
||||
|
|
@ -660,7 +660,7 @@ function ErrorCard({ result }: { result: ErrorResult }) {
|
|||
|
||||
function NotFoundCard({ result }: { result: NotFoundResult }) {
|
||||
return (
|
||||
<div className="my-4 max-w-lg overflow-hidden rounded-2xl border bg-muted/30">
|
||||
<div className="my-4 max-w-lg overflow-hidden rounded-2xl border bg-muted/30 select-none">
|
||||
<div className="px-5 pt-5 pb-4">
|
||||
<p className="text-sm font-semibold text-amber-600 dark:text-amber-400">
|
||||
Issue not found
|
||||
|
|
@ -676,7 +676,7 @@ function NotFoundCard({ result }: { result: NotFoundResult }) {
|
|||
|
||||
function SuccessCard({ result }: { result: SuccessResult }) {
|
||||
return (
|
||||
<div className="my-4 max-w-lg overflow-hidden rounded-2xl border bg-muted/30">
|
||||
<div className="my-4 max-w-lg overflow-hidden rounded-2xl border bg-muted/30 select-none">
|
||||
<div className="px-5 pt-5 pb-4">
|
||||
<p className="text-sm font-semibold text-foreground">
|
||||
{result.message || "Linear issue updated successfully"}
|
||||
|
|
@ -721,9 +721,9 @@ export const UpdateLinearIssueToolUI = makeAssistantToolUI<
|
|||
render: function UpdateLinearIssueUI({ result, status }) {
|
||||
if (status.type === "running") {
|
||||
return (
|
||||
<div className="my-4 max-w-lg rounded-2xl border bg-muted/30 px-5 py-4">
|
||||
<TextShimmerLoader text="Preparing Linear issue update..." size="sm" />
|
||||
</div>
|
||||
<div className="my-4 max-w-lg rounded-2xl border bg-muted/30 px-5 py-4 select-none">
|
||||
<TextShimmerLoader text="Preparing Linear issue update..." size="sm" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue