import { NoteStatus } from "@/types/noteStatus"; import React from "react"; import { Input } from "@/components/atoms/Input"; import { StatusIcon } from "@/components/atoms/StatusIcon"; import { IconSelectionField } from "./IconSelectionField"; export type Props = { status: NoteStatus; index: number; onCustomStatusChange: ( index: number, column: "name" | "icon" | "color" | "description" | "lucideIcon", value: string, ) => void; onCustomStatusRemove: (index: number) => void; onMoveUp?: (index: number) => void; onMoveDown?: (index: number) => void; canMoveUp?: boolean; canMoveDown?: boolean; }; export const CustomStatusItem: React.FC = ({ status, index, onCustomStatusChange, onCustomStatusRemove, onMoveUp, onMoveDown, canMoveUp = false, canMoveDown = false, }) => { const isValid = status.name.trim().length > 0; return (
onCustomStatusChange(index, "icon", value || "") } emojiLabel="Emoji icon" emojiPlaceholder="Example: ✅ or 🚧" emojiHint="Shown anywhere Lucide is not available." lucideValue={status.lucideIcon || ""} onLucideChange={(value) => onCustomStatusChange(index, "lucideIcon", value) } lucideLabel="Lucide icon (optional)" lucidePlaceholder="Browse Lucide icons" lucideHint="Matches Obsidian's toolbar icons so your status button blends in." /> {/* Simple horizontal layout with remaining inputs */}
{/* Name field */}
onCustomStatusChange(index, "name", value || "") } placeholder="e.g. In Progress" className={`custom-status-item__input custom-status-item__input--name ${ !isValid ? "custom-status-item__input--invalid" : "" }`} />
{/* Description field */}
onCustomStatusChange(index, "description", value) } placeholder="Optional description" className="custom-status-item__input custom-status-item__input--description" />
{/* Color picker */}
onCustomStatusChange(index, "color", value) } className="custom-status-item__input custom-status-item__input--color" />
{/* Reorder buttons */} {(onMoveUp || onMoveDown) && (
)} {/* Remove button */}
{/* Preview row - shows how the status will look */}
{status.name || "Status name"} {status.description && ( {status.description} )}
{/* Validation message */} {!isValid && (
Please enter a status name
)}
); };