Blame view

美国版/Food Labeling Management Platform/src/components/labels/MultipleOptionsView.tsx 2.92 KB
884054fb   “wangming”   项目初始化
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 React from 'react';
  import {
    Table,
    TableBody,
    TableCell,
    TableHead,
    TableHeader,
    TableRow,
  } from "../ui/table";
  import { Input } from "../ui/input";
  import { Button } from "../ui/button";
  import {
    Select,
    SelectContent,
    SelectItem,
    SelectTrigger,
    SelectValue,
  } from "../ui/select";
  import { Plus } from "lucide-react";
  
  export function MultipleOptionsView() {
    const options = [
      {
        id: 1,
        name: 'Prepped By',
        contents: 'A. Smith; B. Doe; C. Borne',
        lastEdited: '2025.12.03.11:45',
      },
      {
        id: 2,
        name: 'Checked By',
        contents: 'D. Manager; E. Supervisor',
        lastEdited: '2025.12.04.09:30',
      },
      {
        id: 3,
        name: 'Allergens',
        contents: 'Peanuts; Dairy; Gluten; Soy',
        lastEdited: '2025.12.05.14:15',
      },
    ];
  
    return (
      <div className="space-y-6">
        {/* Top Controls - single row, style consistent with other Label views */}
        <div className="flex flex-nowrap items-center gap-3">
          <Input
            placeholder="Search"
            style={{ height: 40, boxSizing: 'border-box' }}
            className="bg-white border border-gray-300 rounded-md w-40 shrink-0 placeholder:text-gray-500"
          />
          <Select defaultValue="all">
            <SelectTrigger className="bg-white border border-gray-300 rounded-md w-[200px] shrink-0" style={{ height: 40, boxSizing: 'border-box' }}>
              <SelectValue placeholder="Location" />
            </SelectTrigger>
            <SelectContent>
              <SelectItem value="all">All Locations</SelectItem>
              <SelectItem value="loc-a">Location A</SelectItem>
              <SelectItem value="loc-b">Location B</SelectItem>
            </SelectContent>
          </Select>
          <Button className="bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-md h-10 px-6 shrink-0 ml-auto">
            New Multiple Options <Plus className="ml-1 h-4 w-4" />
          </Button>
        </div>
  
        {/* Table */}
        <div className="rounded-md border bg-white shadow-sm">
          <Table>
            <TableHeader>
              <TableRow className="bg-gray-50 hover:bg-gray-50">
                <TableHead className="font-bold text-gray-900 w-[200px]">Multiple Option Name</TableHead>
                <TableHead className="font-bold text-gray-900">Contents</TableHead>
                <TableHead className="font-bold text-gray-900 w-[180px]">Last Edited</TableHead>
              </TableRow>
            </TableHeader>
            <TableBody>
              {options.map((item) => (
                <TableRow key={item.id} className="hover:bg-gray-50">
                  <TableCell className="font-medium">{item.name}</TableCell>
                  <TableCell className="text-gray-600">{item.contents}</TableCell>
                  <TableCell className="text-gray-500 tabular-nums font-numeric">{item.lastEdited}</TableCell>
                </TableRow>
              ))}
            </TableBody>
          </Table>
        </div>
      </div>
    );
  }