Skip to content

Commit

Permalink
refactor: TS product type detecting changed
Browse files Browse the repository at this point in the history
  • Loading branch information
hanifisenturk committed Aug 16, 2024
1 parent 569498a commit ac3b93b
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/components/pricing/product-toggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,14 @@ import IconQStash from "@/components/icon-qstash";
import IconRedis from "@/components/icon-redis";
import IconVector from "@/components/icon-vector";

type Product = "/redis" | "/kafka" | "/vector" | "/qstash";

const productConfig: Record<
Product,
{ name: string; Icon: React.ComponentType<{ width: number }> }
> = {
const productConfig = {
"/redis": { name: "Redis", Icon: IconRedis },
"/kafka": { name: "Kafka", Icon: IconKafka },
"/vector": { name: "Vector", Icon: IconVector },
"/qstash": { name: "QStash", Icon: IconQStash },
};
} as const;

type Product = keyof typeof productConfig;

export default function ProductToggle({ product }: { product: Product }) {
return (
Expand Down

0 comments on commit ac3b93b

Please sign in to comment.