diff --git a/src/components/SnippetCard.tsx b/src/components/SnippetCard.tsx
index b493722..0e3f016 100644
--- a/src/components/SnippetCard.tsx
+++ b/src/components/SnippetCard.tsx
@@ -1,174 +1,174 @@
-import { useState, useMemo } from 'react'
-import { Badge } from '@/components/ui/badge'
-import { Button } from '@/components/ui/button'
-import { Card } from '@/components/ui/card'
-import { cn } from '@/lib/utils'
-import { Copy, Pencil, Trash, Eye } from '@phosphor-icons/react'
-import { Snippet, LANGUAGE_COLORS } from '@/lib/types'
-
-interface SnippetCardProps {
- snippet: Snippet
- onEdit: (snippet: Snippet) => void
- onDelete: (id: string) => void
- onCopy: (code: string) => void
- onView: (snippet: Snippet) => void
-}
-
-export function SnippetCard({ snippet, onEdit, onDelete, onCopy, onView }: SnippetCardProps) {
- const [isCopied, setIsCopied] = useState(false)
- const [hasRenderError, setHasRenderError] = useState(false)
-
- const safeSnippet = useMemo(() => {
- try {
- const title = snippet?.title || 'Untitled Snippet'
- const code = snippet?.code || ''
- const description = snippet?.description || ''
- const maxCodeLength = 100
- const isTruncated = code.length > maxCodeLength
- const displayCode = isTruncated ? code.slice(0, maxCodeLength) + '...' : code
-
- return {
- title,
- description,
- displayCode,
- fullCode: code,
- isTruncated,
- language: snippet?.language || 'Other',
- hasPreview: snippet?.hasPreview || false
- }
- } catch {
- setHasRenderError(true)
- return {
- title: 'Error Loading Snippet',
- description: 'This snippet could not be loaded properly',
- displayCode: '',
- fullCode: '',
- isTruncated: false,
- language: 'Other',
- hasPreview: false
- }
- }
- }, [snippet])
-
- const handleCopy = (e: React.MouseEvent) => {
- e.stopPropagation()
- onCopy(safeSnippet.fullCode)
- setIsCopied(true)
- setTimeout(() => setIsCopied(false), 2000)
- }
-
- const handleEdit = (e: React.MouseEvent) => {
- e.stopPropagation()
- onEdit(snippet)
- }
-
- const handleDelete = (e: React.MouseEvent) => {
- e.stopPropagation()
- onDelete(snippet.id)
- }
-
- const handleView = (e: React.MouseEvent) => {
- e.stopPropagation()
- onView(snippet)
- }
-
- if (hasRenderError) {
- return (
- Error rendering snippet
- {safeSnippet.description}
-
- Click to view full code
-
- {safeSnippet.title}
-
- {safeSnippet.description && (
-
- {safeSnippet.displayCode}
-
- {safeSnippet.isTruncated && (
-