diff --git a/src/components/layout/content.tsx b/src/components/layout/content.tsx
index c2023df..a49b643 100644
--- a/src/components/layout/content.tsx
+++ b/src/components/layout/content.tsx
@@ -11,6 +11,7 @@ import { Heading } from '../ui/heading.tsx'
import { LoadingState } from '../ui/loading-state.tsx'
import { PageTitle } from '../ui/page-title.tsx'
import DragNDrop from '../upload/drag-n-drop.tsx'
+import { UploadError } from '../upload/upload-error.tsx'
import { UploadStatus } from '../upload/upload-status.tsx'
// Completed state for displaying upload history
@@ -87,6 +88,10 @@ export default function Content() {
{showActiveUpload && uploadedFile && (
Current upload
+
+ {/* Show error alert if upload failed */}
+
+
['variant']>
-export type AlertVariant = keyof typeof variantConfig
+type ButtonType = {
+ children: React.ReactNode
+ onClick?: React.ComponentProps<'button'>['onClick']
+}
type AlertProps = {
- variant: AlertVariant
+ variant?: AlertVariant
message: string
- button?: {
- children: string
- onClick: React.ComponentProps<'button'>['onClick']
- }
+ description?: string
+ button?: ButtonType
+ cancelButton?: ButtonType
+}
+
+const ICONS: Record = {
+ success: CircleCheck,
+ error: AlertTriangle,
+ info: Info,
+ warning: CircleAlert,
+ neutral: CircleAlert,
}
-function Alert({ variant, message, button }: AlertProps) {
- const { containerClass, textClass, iconClass, buttonClass, Icon } = variantConfig[variant]
+export function Alert({ variant = 'neutral', message, description, button, cancelButton }: AlertProps) {
+ const Icon = ICONS[variant]
return (
-
-
+
+
-
{message}
- {button && (
-
+
+
+ {message}
+ {description && {description}}
+
+
+ {(button || cancelButton) && (
+
+ {cancelButton && (
+
+ )}
+ {button && (
+
+ )}
+
)}
)
}
-
-export { Alert }
diff --git a/src/components/ui/button/button-base.tsx b/src/components/ui/button/button-base.tsx
index 1e4eafc..ddb1ab0 100644
--- a/src/components/ui/button/button-base.tsx
+++ b/src/components/ui/button/button-base.tsx
@@ -2,12 +2,18 @@ import { cva, type VariantProps } from 'class-variance-authority'
import { cn } from '@/utils/cn.ts'
const buttonVariants = cva(
- 'inline-flex items-center justify-center font-medium px-5 py-3 rounded-md transition-colors w-full hover:opacity-90',
+ 'inline-flex items-center justify-center font-medium transition-colors w-full cursor-pointer',
{
variants: {
variant: {
- primary: 'bg-brand-800 text-zinc-100 border border-transparent disabled:bg-button-brand-disabled',
+ primary:
+ 'bg-brand-800 text-zinc-100 border border-transparent disabled:bg-button-brand-disabled hover:bg-brand-700',
secondary: 'bg-transparent text-zinc-100 border border-zinc-800 hover:bg-zinc-800',
+ unstyled: '',
+ },
+ size: {
+ sm: 'text-sm px-4 py-2 rounded-md',
+ md: 'text-base px-5 py-3 rounded-lg',
},
loading: {
true: 'cursor-wait',
@@ -19,6 +25,7 @@ const buttonVariants = cva(
},
},
defaultVariants: {
+ size: 'md',
variant: 'primary',
loading: false,
disabled: false,
@@ -31,10 +38,10 @@ type ButtonBaseProps = React.ButtonHTMLAttributes &
loading?: boolean
}
-function ButtonBase({ className, variant, loading, children, disabled, ...props }: ButtonBaseProps) {
+function ButtonBase({ className, variant, loading, children, disabled, size = 'md', ...props }: ButtonBaseProps) {
return (