mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-10-13 20:46:38 +08:00
feat(frontend): add shadcn ui primitives and compatibility bridge
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import * as React from "react";
|
||||
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
type LinkColor = "default" | "foreground" | "primary";
|
||||
|
||||
export interface LinkProps extends React.ComponentProps<"a"> {
|
||||
color?: LinkColor;
|
||||
}
|
||||
|
||||
function mapColor(color: LinkColor) {
|
||||
if (color === "primary") {
|
||||
return "text-primary hover:text-primary/80";
|
||||
}
|
||||
if (color === "foreground") {
|
||||
return "text-foreground hover:text-foreground/80";
|
||||
}
|
||||
|
||||
return "text-default-600 hover:text-default-700";
|
||||
}
|
||||
|
||||
export function Link({ className, color = "default", ...props }: LinkProps) {
|
||||
return <a className={cn("transition-colors", mapColor(color), className)} {...props} />;
|
||||
}
|
||||
Reference in New Issue
Block a user