import * as React from "react";
import { Card, CardContent } from "@/components/ui/card";
import { Input } from "@/components/ui/input";
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select";
import {
Table,
TableBody,
TableCell,
TableHead,
TableHeader,
TableRow,
} from "@/components/ui/table";
import type { HardwareDatabaseRow, SelectOption } from "@/types/local-frontier";
export type HardwareDatabaseProps = {
rows: readonly HardwareDatabaseRow[];
producers: readonly SelectOption[];
priceBands: readonly SelectOption[];
};
function matchesRow(
row: HardwareDatabaseRow,
search: string,
producer: string,
priceBand: string,
): boolean {
const query = search.trim().toLowerCase();
return (
(!query || row.searchText.includes(query)) &&
(producer === "all" || row.acceleratorVendorKey === producer) &&
(priceBand === "all" || row.priceBand === priceBand)
);
}
function FilterSelect({
label,
value,
options,
onValueChange,
}: {
label: string;
value: string;
options: readonly SelectOption[];
onValueChange: (value: string) => void;
}): React.JSX.Element {
return (
);
}
function HardwareRow({ row }: { row: HardwareDatabaseRow }): React.JSX.Element {
return (