feat: copy button

This commit is contained in:
jason 2024-09-11 22:54:47 -07:00
parent 1012f562ff
commit 4382f7165c
22 changed files with 197 additions and 752 deletions

View file

@ -40,11 +40,11 @@ if (
>
<Link
href={`/${entry.collection}/${entry.slug}`}
class="flex flex-wrap gap-4"
class="flex flex-col gap-4 sm:flex-row"
>
{
entry.data.image && (
<div class="flex-shrink-0">
<div class="sm:flex-shrink-0">
<Image
src={entry.data.image}
alt={entry.data.title}
@ -63,7 +63,7 @@ if (
{entry.data.description}
</p>
<div
class="mb-2 flex items-center space-x-2 text-xs text-muted-foreground"
class="mb-2 flex flex-wrap items-center gap-x-2 text-xs text-muted-foreground"
>
{
author && (

View file

@ -1,5 +1,11 @@
---
import { cn } from '@/lib/utils'
interface Props {
class?: string
}
const { class: className } = Astro.props
---
---
<div class="mx-auto max-w-screen-md"><slot /></div>
<div class={cn('mx-auto max-w-screen-md', className)}><slot /></div>

View file

@ -24,7 +24,7 @@ const {
target={external ? '_blank' : '_self'}
class={cn(
'inline-block transition-colors duration-300 ease-in-out',
underline && 'hover:underline hover:underline-offset-[3px]',
underline && 'underline underline-offset-[3px]',
className,
)}
data-heading={dataHeading}

View file

@ -1,10 +1,11 @@
import { cva, type VariantProps } from 'class-variance-authority'
import { Hash } from 'lucide-react'
import * as React from 'react'
import { cn } from '@/lib/utils'
const badgeVariants = cva(
'inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',
'inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',
{
variants: {
variant: {
@ -29,7 +30,10 @@ export interface BadgeProps
function Badge({ className, variant, ...props }: BadgeProps) {
return (
<div className={cn(badgeVariants({ variant }), className)} {...props} />
<div className={cn(badgeVariants({ variant }), className)} {...props}>
<Hash className="mr-0.5 h-3 w-3" />
{props.children}
</div>
)
}