mirror of
https://gitea.gofwd.group/sean/gunbuilder-next-tailwind.git
synced 2025-12-06 02:56:45 -05:00
clean up stuff
This commit is contained in:
@@ -261,6 +261,9 @@ const getProductCategoryForComponent = (componentName: string): string => {
|
||||
return componentMap[componentName] || 'Lower Receiver';
|
||||
};
|
||||
|
||||
// Add a slugify helper at the top of the file
|
||||
const slugify = (str: string) => str?.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/(^-|-$)+/g, '');
|
||||
|
||||
export { buildGroups };
|
||||
export default function BuildPage() {
|
||||
const [sortField, setSortField] = useState<SortField>('name');
|
||||
@@ -404,7 +407,7 @@ export default function BuildPage() {
|
||||
</div>
|
||||
<div className="text-center flex flex-col items-center md:flex-row md:justify-center md:items-center gap-2">
|
||||
<div>
|
||||
<div className="text-2xl font-bold text-blue-600">${actualTotalCost.toFixed(2)}</div>
|
||||
<div className="text-2xl font-bold text-primary">${actualTotalCost.toFixed(2)}</div>
|
||||
<div className="text-sm text-gray-500">Total Cost</div>
|
||||
</div>
|
||||
<button
|
||||
@@ -616,9 +619,6 @@ export default function BuildPage() {
|
||||
<span className="text-sm">{getSortIcon('estimatedPrice')}</span>
|
||||
</div>
|
||||
</th>
|
||||
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
||||
Notes
|
||||
</th>
|
||||
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
||||
Selected Product
|
||||
</th>
|
||||
@@ -638,7 +638,7 @@ export default function BuildPage() {
|
||||
<React.Fragment key={group.name}>
|
||||
{/* Group Header */}
|
||||
<tr className="bg-gray-100">
|
||||
<td colSpan={7} className="px-6 py-2">
|
||||
<td colSpan={5} className="px-6 py-2">
|
||||
<div className="flex items-center">
|
||||
<div>
|
||||
<h3 className="text-sm font-semibold text-gray-700">{group.name}</h3>
|
||||
@@ -673,7 +673,7 @@ export default function BuildPage() {
|
||||
<div className="text-sm font-medium text-gray-900">
|
||||
<Link
|
||||
href={`/products/${selected.id}`}
|
||||
className="text-blue-600 hover:text-blue-800 hover:underline"
|
||||
className="text-primary hover:text-blue-800 hover:underline"
|
||||
>
|
||||
{selected.name}
|
||||
</Link>
|
||||
@@ -709,11 +709,6 @@ export default function BuildPage() {
|
||||
</div>
|
||||
)}
|
||||
</td>
|
||||
<td className="px-6 py-4">
|
||||
<div className="text-sm text-gray-500 max-w-xs">
|
||||
{component.notes}
|
||||
</div>
|
||||
</td>
|
||||
<td className="px-6 py-4 whitespace-nowrap text-sm font-medium">
|
||||
{selected ? (
|
||||
<button
|
||||
@@ -724,7 +719,7 @@ export default function BuildPage() {
|
||||
</button>
|
||||
) : (
|
||||
<Link
|
||||
href={`/parts?category=${encodeURIComponent(getProductCategoryForComponent(component.name))}`}
|
||||
href={`/parts/${slugify(getProductCategoryForComponent(component.name))}`}
|
||||
className="bg-blue-600 hover:bg-blue-700 text-white px-3 py-1 rounded-md text-sm font-medium transition-colors"
|
||||
>
|
||||
Find Parts
|
||||
@@ -739,7 +734,7 @@ export default function BuildPage() {
|
||||
})
|
||||
) : (
|
||||
<tr>
|
||||
<td colSpan={7} className="px-6 py-12 text-center">
|
||||
<td colSpan={5} className="px-6 py-12 text-center">
|
||||
<div className="text-gray-500">
|
||||
<div className="text-lg font-medium mb-2">No components found</div>
|
||||
<div className="text-sm">Try adjusting your filters or search terms</div>
|
||||
@@ -757,7 +752,7 @@ export default function BuildPage() {
|
||||
<div className="text-sm text-gray-700">
|
||||
Showing {sortedComponents.length} of {allComponents.length} components
|
||||
{hasActiveFilters && (
|
||||
<span className="ml-2 text-blue-600">
|
||||
<span className="ml-2 text-primary">
|
||||
(filtered)
|
||||
</span>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user