import * as React from 'react'; import { Check, Layers, LayoutTemplate, Sparkles } from 'lucide-react'; import { cn } from '@/lib/utils'; /** * Which surface this capability should run on. * * This used to be a read-out — two rows saying "✓ Owliver / — Board". It is now * the choice it always described, and the constraint is the important part: * **what can be picked is derived from the definition, never from a name.** A * skill's facets say whether it teaches Owliver, draws on a page, or both, and * an option the definition does not support is offered disabled with the reason * rather than hidden — a reader deciding between surfaces should be able to see * that the other one exists and why it is not available here. * * `Both` appears only when the definition genuinely supports both. Selecting it * forks nothing: there is one logical skill, and this is a mode on it. */ const OPTIONS = [ { id: 'owliver', icon: Sparkles, label: 'Owliver', hint: 'Can be asked for in the assistant.', supported: (type) => type === 'owliver' || type === 'both', }, { id: 'board', icon: LayoutTemplate, label: 'Board', hint: 'Draws a section on the page.', supported: (type) => type === 'board' || type === 'both', }, { id: 'both', icon: Layers, label: 'Both', hint: 'Assistant and page.', supported: (type) => type === 'both', }, ]; /** The surfaces this definition can be run on, in order. */ export const supportedSurfaces = (type) => OPTIONS.filter((o) => o.supported(type)).map((o) => o.id); export function SurfaceSelect({ type, value, onChange, name }: any) { return (
{OPTIONS.map((option) => { const available = option.supported(type); const selected = available && value === option.id; const Icon = option.icon; return ( ); })}
); } export default SurfaceSelect;