hezarfen_frontend
Clone
https://git.tahinli.com/archive/hezarfen_frontend.git
0 watching0 forksTypeScript5.5 MiBdcf123aBurak Boduroğlu2 months ago674 commits
| 1 | import type { ComponentProps, ParentProps } from "solid-js"; |
| 2 | import { splitProps } from "solid-js"; |
| 3 | import { cn } from "@/lib/cn"; |
| 4 | |
| 5 | export function Card(props: ParentProps<ComponentProps<"div">>) { |
| 6 | const [local, rest] = splitProps(props, ["class", "children"]); |
| 7 | return ( |
| 8 | <div |
| 9 | class={cn( |
| 10 | "rounded-lg border border-border-line bg-surface-base text-card-foreground shadow-sm", |
| 11 | local.class, |
| 12 | )} |
| 13 | {...rest} |
| 14 | > |
| 15 | {local.children} |
| 16 | </div> |
| 17 | ); |
| 18 | } |
| 19 | |
| 20 | export function CardHeader(props: ParentProps<ComponentProps<"div">>) { |
| 21 | const [local, rest] = splitProps(props, ["class", "children"]); |
| 22 | return ( |
| 23 | <div class={cn("flex flex-col space-y-1.5 p-6", local.class)} {...rest}> |
| 24 | {local.children} |
| 25 | </div> |
| 26 | ); |
| 27 | } |
| 28 | |
| 29 | export function CardTitle(props: ParentProps<ComponentProps<"h3">>) { |
| 30 | const [local, rest] = splitProps(props, ["class", "children"]); |
| 31 | return ( |
| 32 | <h3 class={cn("font-semibold leading-none tracking-tight", local.class)} {...rest}> |
| 33 | {local.children} |
| 34 | </h3> |
| 35 | ); |
| 36 | } |
| 37 | |
| 38 | export function CardDescription(props: ParentProps<ComponentProps<"p">>) { |
| 39 | const [local, rest] = splitProps(props, ["class", "children"]); |
| 40 | return ( |
| 41 | <p class={cn("text-sm text-muted-foreground", local.class)} {...rest}> |
| 42 | {local.children} |
| 43 | </p> |
| 44 | ); |
| 45 | } |
| 46 | |
| 47 | export function CardContent(props: ParentProps<ComponentProps<"div">>) { |
| 48 | const [local, rest] = splitProps(props, ["class", "children"]); |
| 49 | return ( |
| 50 | <div class={cn("p-6 pt-0", local.class)} {...rest}> |
| 51 | {local.children} |
| 52 | </div> |
| 53 | ); |
| 54 | } |
| 55 | |
| 56 | export function CardFooter(props: ParentProps<ComponentProps<"div">>) { |
| 57 | const [local, rest] = splitProps(props, ["class", "children"]); |
| 58 | return ( |
| 59 | <div class={cn("flex items-center p-6 pt-0", local.class)} {...rest}> |
| 60 | {local.children} |
| 61 | </div> |
| 62 | ); |
| 63 | } |