"use client"; import React, { useState } from "react"; import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from "@/components/ui/dialog"; import { Button } from "@/components/ui/button"; import { Label } from "@/components/ui/label"; import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"; import { Input } from "@/components/ui/input"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; import { Badge } from "@/components/ui/badge"; import { ArrowRight, ArrowDown } from "lucide-react"; interface FlowButtonGroupDialogProps { open: boolean; onOpenChange: (open: boolean) => void; buttonCount: number; onConfirm: (settings: { direction: "horizontal" | "vertical"; gap: number; align: "start" | "center" | "end" | "space-between" | "space-around"; }) => void; } export const FlowButtonGroupDialog: React.FC = ({ open, onOpenChange, buttonCount, onConfirm, }) => { const [direction, setDirection] = useState<"horizontal" | "vertical">("horizontal"); const [gap, setGap] = useState(8); const [align, setAlign] = useState<"start" | "center" | "end" | "space-between" | "space-around">("start"); const handleConfirm = () => { onConfirm({ direction, gap, align }); onOpenChange(false); }; return ( 플로우 버튼 그룹 생성 {buttonCount}개의 버튼을 하나의 그룹으로 묶습니다. 자동 정렬 설정을 지정하세요.
{/* 정렬 방향 */}
setDirection(value)}>
{/* 버튼 간격 */}
setGap(Number(e.target.value))} className="h-6 w-full px-2 py-0 text-xs" style={{ fontSize: "12px" }} /> {gap}px

버튼 사이의 간격을 설정합니다

{/* 정렬 방식 */}

버튼들이 그룹 내에서 어떻게 배치될지 결정합니다

{/* 미리보기 */}

설정 미리보기

{direction === "horizontal" ? : } {direction === "horizontal" ? "가로" : "세로"} 방향으로 {gap}px 간격
{align === "start" && "시작점"} {align === "center" && "중앙"} {align === "end" && "끝점"} {align === "space-between" && "양 끝"} {align === "space-around" && "균등"} 정렬
); };