Skip to content

Commit

Permalink
used getFootprintNamesByType() (#585)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShiboSoftwareDev authored Jan 17, 2025
1 parent dd13d6f commit 1012359
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"@radix-ui/react-toggle-group": "^1.1.0",
"@radix-ui/react-tooltip": "^1.1.2",
"@tscircuit/3d-viewer": "^0.0.96",
"@tscircuit/footprinter": "^0.0.99",
"@tscircuit/footprinter": "^0.0.101",
"@tscircuit/layout": "^0.0.29",
"@tscircuit/math-utils": "^0.0.10",
"@tscircuit/mm": "^0.0.8",
Expand Down
9 changes: 3 additions & 6 deletions src/components/FootprintDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useEffect, useMemo, useState } from "react"
import { parseFootprintParams } from "../lib/utils/parseFootprintParams"
import ParametersEditor from "./ParametersEditor"
import { convertCircuitJsonToPcbSvg } from "circuit-to-svg"
import { fp } from "@tscircuit/footprinter"
import { fp, getFootprintNamesByType } from "@tscircuit/footprinter"
import { useToast } from "../hooks/use-toast"
import { Button } from "./ui/button"
import { FileName } from "./CodeEditorHeader"
Expand Down Expand Up @@ -53,10 +53,7 @@ export const FootprintDialog = ({
const [error, setError] = useState<string | null>(null)
const { toast } = useToast()

const PASSIVE_COMPONENTS = ["diode", "led", "resistor", "cap", "res"]
const footprintNames = fp
.getFootprintNames()
.filter((footprintName) => !PASSIVE_COMPONENTS.includes(footprintName))
const { normalFootprintNames } = getFootprintNamesByType()

useEffect(() => {
if (copied) {
Expand Down Expand Up @@ -266,7 +263,7 @@ export const FootprintDialog = ({
handleFootprintPreview(value)
}
}}
options={footprintNames}
options={normalFootprintNames}
placeholder="Select footprint..."
searchPlaceholder="Search footprints..."
emptyText="No footprints found."
Expand Down

0 comments on commit 1012359

Please sign in to comment.