diff --git a/src/components/ui/alert.tsx b/src/components/ui/alert.tsx new file mode 100644 index 0000000..2ae72c2 --- /dev/null +++ b/src/components/ui/alert.tsx @@ -0,0 +1,61 @@ +import * as React from "react" +import { cva, type VariantProps } from "class-variance-authority" + +import { cn } from "@/lib/utils" + +const alertVariants = cva( + "relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground", + { + variants: { + variant: { + default: "bg-background text-foreground", + destructive: + "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive", + warning: + "border-[#fdf5d3] dark:border-[#3d3d00] text-[#dc7609] dark:text-[#f3cf58] [&>svg]:text-[#dc7609] [&>svg]:dark:text-[#f3cf58]", + }, + }, + defaultVariants: { + variant: "default", + }, + } +) + +const Alert = React.forwardRef< + HTMLDivElement, + React.HTMLAttributes & VariantProps +>(({ className, variant, ...props }, ref) => ( +
+)) +Alert.displayName = "Alert" + +const AlertTitle = React.forwardRef< + HTMLParagraphElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( +
+)) +AlertTitle.displayName = "AlertTitle" + +const AlertDescription = React.forwardRef< + HTMLParagraphElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( +
+)) +AlertDescription.displayName = "AlertDescription" + +export { Alert, AlertTitle, AlertDescription } diff --git a/src/routes/index.lazy.tsx b/src/routes/index.lazy.tsx index 4a37991..ae2c448 100644 --- a/src/routes/index.lazy.tsx +++ b/src/routes/index.lazy.tsx @@ -1,21 +1,31 @@ import { useMemo, useState } from 'react' +import { Info, TriangleAlert, Upload } from "lucide-react" import { createLazyFileRoute } from '@tanstack/react-router' import { useLocalStorage } from '@/hooks/use-local-storage' import { useBreakpoint } from '@/hooks/use-breakpoint' import { STORAGE_KEYS } from '@/constants/storage-keys' -import { useTheme } from "@/components/theme/theme-provider" import { calculateWAM, calculateGPA, calculateTotalCredits, calculateColor } from "@/lib/calculate" -import { toast } from "sonner" import { Result } from "@/schemas/result-schema" +import { toast } from "sonner" + +import { useTheme } from "@/components/theme/theme-provider" import { ResultTable } from "@/components/results/result-table" import { RadialChart } from "@/components/results/radial-chart" +import { Button } from "@/components/ui/button" import { Card, CardContent, CardHeader, CardTitle, } from "@/components/ui/card" -import { Button } from "@/components/ui/button" +import { + Dialog, + DialogContent, + DialogDescription, + DialogHeader, + DialogTitle, + DialogTrigger, +} from "@/components/ui/dialog" export const Route = createLazyFileRoute('/')({ component: Index, @@ -197,10 +207,49 @@ function Index() {
-
-

Credits:

-

Total credit points:

- {totalCredits} +
+
+

Credits:

+

Credit points:

+

Total credit points:

+ {totalCredits} +
+
+
+ +

Uploading CSV will replace all current data.

+
+ + + + + + + Upload CSV + + yeah mate + + + + + + + + + + + How to upload CSV + + yeah mate + + + + +