import type { ComponentType } from "react";

import { ClipFrameExtractorTool } from "@/components/tools/clip-frame-extractor-tool";
import { ExtractAudioTool } from "@/components/tools/extract-audio-tool";
import { VideoFormatConverterTool } from "@/components/tools/video-format-converter-tool";
import { VideoThumbnailCreatorTool } from "@/components/tools/video-thumbnail-creator-tool";
import type { RegisteredToolSlug } from "@/lib/tools-registry";

export const toolPageComponents: Record<RegisteredToolSlug, ComponentType> = {
  "clip-frame-extractor": ClipFrameExtractorTool,
  "extract-audio": ExtractAudioTool,
  "video-thumbnail-creator": VideoThumbnailCreatorTool,
  "video-format-converter": VideoFormatConverterTool
};

export function getToolPageComponent(slug: string) {
  if (slug in toolPageComponents) {
    return toolPageComponents[slug as RegisteredToolSlug];
  }

  return null;
}
