# All files / src/components/organisms/showcases ContentGridsShowcase.tsx

0% Statements 0/89
0% Branches 0/1
0% Functions 0/1
0% Lines 0/89

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90

     import { Card } from '@/components/ui/card'
    import { Button } from '@/components/ui/button'
    import { Badge } from '@/components/ui/badge'
    import {
      List,
      GridFour,
    } from '@phosphor-icons/react'
    import { useState } from 'react'

    export function ContentGridsShowcase() {
      const [viewMode, setViewMode] = useState<'grid' | 'list'>('grid')

      return (
        <section className="space-y-6">
          <div>
            <h2 className="text-3xl font-bold mb-2">Content Grids</h2>
            <p className="text-muted-foreground">
              Switchable grid and list views with filtering
            </p>
          </div>

          <Card>
            <div className="p-4 border-b border-border">
              <div className="flex items-center justify-between flex-wrap gap-4">
                <h3 className="font-semibold text-lg">Projects</h3>
                <div className="flex items-center gap-2">
                  <Button
                    variant={viewMode === 'grid' ? 'filled' : 'outline'}
                    size="icon"
                    onClick={() => setViewMode('grid')}
                  >
                    <GridFour />
                  </Button>
                  <Button
                    variant={viewMode === 'list' ? 'filled' : 'outline'}
                    size="icon"
                    onClick={() => setViewMode('list')}
                  >
                    <List />
                  </Button>
                </div>
              </div>
            </div>

            {viewMode === 'grid' ? (
              <div className="p-6 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4">
                {[1, 2, 3, 4, 5, 6].map((i) => (
                  <Card key={i} className="p-4 hover:shadow-lg transition-shadow">
                    <div className="space-y-3">
                      <div className="h-32 rounded-lg bg-gradient-to-br from-primary to-accent" />
                      <h4 className="font-semibold">Project {i}</h4>
                      <p className="text-sm text-muted-foreground line-clamp-2">
                        A brief description of this project and its goals.
                      </p>
                      <div className="flex items-center justify-between pt-2">
                        <Badge variant="outline">Active</Badge>
                        <Button variant="ghost" size="sm">
                          View
                        </Button>
                      </div>
                    </div>
                  </Card>
                ))}
              </div>
            ) : (
              <div className="divide-y divide-border">
                {[1, 2, 3, 4, 5, 6].map((i) => (
                  <div key={i} className="p-4 hover:bg-muted/50 transition-colors">
                    <div className="flex items-center gap-4">
                      <div className="h-16 w-16 rounded-lg bg-gradient-to-br from-primary to-accent flex-shrink-0" />
                      <div className="flex-1 min-w-0">
                        <h4 className="font-semibold">Project {i}</h4>
                        <p className="text-sm text-muted-foreground">
                          A brief description of this project
                        </p>
                      </div>
                      <Badge variant="outline">Active</Badge>
                      <Button variant="ghost" size="sm">
                        View
                      </Button>
                    </div>
                  </div>
                ))}
              </div>
            )}
          </Card>
        </section>
      )
    }