-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(fe): add testcase judge results not available alert when testcas…
…e is outdated (#2235) feat(fe): add Testcase Judge Results Not Available Alert when testcase is outdated
- Loading branch information
Showing
2 changed files
with
79 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<HTMLDivElement> & VariantProps<typeof alertVariants> | ||
>(({ className, variant, ...props }, ref) => ( | ||
<div | ||
ref={ref} | ||
role="alert" | ||
className={cn(alertVariants({ variant }), className)} | ||
{...props} | ||
/> | ||
)) | ||
Alert.displayName = 'Alert' | ||
|
||
const AlertTitle = React.forwardRef< | ||
HTMLParagraphElement, | ||
React.HTMLAttributes<HTMLHeadingElement> | ||
>(({ className, ...props }, ref) => ( | ||
<h5 | ||
ref={ref} | ||
className={cn('mb-1 font-medium leading-none tracking-tight', className)} | ||
{...props} | ||
/> | ||
)) | ||
AlertTitle.displayName = 'AlertTitle' | ||
|
||
const AlertDescription = React.forwardRef< | ||
HTMLParagraphElement, | ||
React.HTMLAttributes<HTMLParagraphElement> | ||
>(({ className, ...props }, ref) => ( | ||
<div | ||
ref={ref} | ||
className={cn('text-sm [&_p]:leading-relaxed', className)} | ||
{...props} | ||
/> | ||
)) | ||
AlertDescription.displayName = 'AlertDescription' | ||
|
||
export { Alert, AlertTitle, AlertDescription } |