'use client'; /** * Step 1: Basic Information * - Bot title * - URL slug * - Description */ import { useEffect } from 'react'; import { TextBox } from '@/components/forms/TextBox'; interface StepBasicInfoProps { title: string; slug: string; description: string; onChange: (data: { title?: string; slug?: string; description?: string }) => void; errors: string[]; } /** * Convert title to URL-friendly slug */ function titleToSlug(title: string): string { return title .toLowerCase() .trim() .replace(/[^a-z0-9\s-]/g, '') .replace(/\s+/g, '-') .replace(/-+/g, '-') .replace(/^-|-$/g, ''); } export function StepBasicInfo({ title, slug, description, onChange, errors }: StepBasicInfoProps) { // Auto-generate slug from title if slug is empty or matches previous auto-generated value useEffect(() => { if (title && !slug) { onChange({ slug: titleToSlug(title) }); } }, [title, slug, onChange]); return (
Give your bot a name and identity. This is how users will find and recognize it.
Lowercase letters, numbers, and hyphens only