diff --git a/apps/frontend/app/admin/contest/[contestId]/_components/SubmissionDetailAdmin.tsx b/apps/frontend/app/admin/contest/[contestId]/_components/SubmissionDetailAdmin.tsx index 23fc08166..63dee729f 100644 --- a/apps/frontend/app/admin/contest/[contestId]/_components/SubmissionDetailAdmin.tsx +++ b/apps/frontend/app/admin/contest/[contestId]/_components/SubmissionDetailAdmin.tsx @@ -1,6 +1,7 @@ 'use client' import CodeEditor from '@/components/CodeEditor' +import { Alert, AlertDescription, AlertTitle } from '@/components/shadcn/alert' import { ScrollArea, ScrollBar } from '@/components/shadcn/scroll-area' import { Table, @@ -15,6 +16,7 @@ import { GET_SUBMISSION } from '@/graphql/submission/queries' import { dateFormatter, getResultColor } from '@/libs/utils' import type { Language } from '@/types/type' import { useLazyQuery, useQuery } from '@apollo/client' +import { IoWarning } from 'react-icons/io5' export default function SubmissionDetailAdmin({ submissionId @@ -125,9 +127,10 @@ export default function SubmissionDetailAdmin({ - {submission?.testcaseResult.length !== 0 && ( -
-

Testcase

+ +

Testcase

+ {submission?.testcaseResult.length !== 0 ? ( +
@@ -201,16 +204,22 @@ export default function SubmissionDetailAdmin({
+ ) : ( + + + Testcase Judge Results Not Available + + The testcases have been recently updated and are now outdated. + + )} -
-

Source Code

- -
+

Source Code

+
)} diff --git a/apps/frontend/components/shadcn/alert.tsx b/apps/frontend/components/shadcn/alert.tsx new file mode 100644 index 000000000..808f3865f --- /dev/null +++ b/apps/frontend/components/shadcn/alert.tsx @@ -0,0 +1,58 @@ +import { cn } from '@/libs/utils' +import { cva, type VariantProps } from 'class-variance-authority' +import * as React from 'react' + +const alertVariants = cva( + 'relative w-full rounded-lg border border-gray-200 px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-gray-950 [&>svg~*]:pl-7 dark:border-gray-800 dark:[&>svg]:text-gray-50', + { + variants: { + variant: { + default: 'bg-white text-gray-950 dark:bg-gray-950 dark:text-gray-50', + destructive: + 'border-red-500/50 text-red-500 dark:border-red-500 [&>svg]:text-red-500 dark:border-red-900/50 dark:text-red-900 dark:dark:border-red-900 dark:[&>svg]:text-red-900' + } + }, + 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 }