Spaces:
Running
Running
Download components/ConceptDetail.js from powerllm/anycoder-3dfb5929: direct link, hf CLI and curl.
- Browser
- Download file 18.1 kB
-
https://huggingface.co/spaces/powerllm/anycoder-3dfb5929/resolve/main/components/ConceptDetail.js
- Command line
-
hf download hf://spaces/powerllm/anycoder-3dfb5929/components/ConceptDetail.js
-
curl -L -o ConceptDetail.js https://huggingface.co/spaces/powerllm/anycoder-3dfb5929/resolve/main/components/ConceptDetail.js
18.1 kB
| import React from 'react'; | |
| const ConceptDetail = ({ concept, onBack }) => { | |
| if (!concept) { | |
| return ( | |
| <div className="flex-1 flex flex-col items-center justify-center text-gray-500 bg-gray-900 p-8"> | |
| <div className="w-24 h-24 rounded-full bg-gray-800 flex items-center justify-center mb-6 animate-pulse"> | |
| <i className="fa-regular fa-folder-open text-6xl opacity-20"></i> | |
| </div> | |
| <h3 className="text-2xl font-semibold text-gray-300 mb-3">Select a Concept</h3> | |
| <p className="max-w-md text-center text-gray-400 leading-relaxed">Choose a concept from the sidebar to view detailed information, entry criteria, risk parameters, and trading strategies based on ICT principles.</p> | |
| </div> | |
| ); | |
| } | |
| return ( | |
| <div className="flex-1 flex flex-col bg-gray-900 h-full overflow-hidden"> | |
| {/* Header */} | |
| <div className="h-16 border-b border-gray-700 flex items-center justify-between px-6 bg-gray-800/50 backdrop-blur-sm sticky top-0 z-30"> | |
| <div className="flex items-center gap-4"> | |
| {onBack && ( | |
| <button | |
| onClick={onBack} | |
| className="p-2 rounded-lg hover:bg-gray-700 text-gray-400 hover:text-white transition-colors" | |
| > | |
| <i className="fa-solid fa-arrow-left"></i> | |
| </button> | |
| )} | |
| <div className="flex items-center gap-3"> | |
| <div className={`p-2 rounded-lg ${ | |
| concept.type === 'core_concept' ? 'bg-blue-500/20 text-blue-400' : | |
| concept.type === 'strategy' ? 'bg-purple-500/20 text-purple-400' : | |
| concept.type === 'risk_management' ? 'bg-red-500/20 text-red-400' : | |
| 'bg-orange-500/20 text-orange-400' | |
| }`}> | |
| <i className={`fa-solid ${getIconForType(concept.type)}`}></i> | |
| </div> | |
| <div> | |
| <h2 className="text-xl font-semibold text-gray-100">{concept.title}</h2> | |
| <p className="text-sm text-gray-400 flex items-center gap-2"> | |
| {concept.description} | |
| <span className="px-2 py-0.5 bg-gray-700 rounded-full text-[10px] text-gray-300 border border-gray-600 font-mono"> | |
| {concept.id.toUpperCase()} | |
| </span> | |
| </p> | |
| </div> | |
| </div> | |
| </div> | |
| <div className="flex items-center gap-3"> | |
| <span className="px-3 py-1.5 bg-green-500/10 text-green-400 text-sm font-bold rounded-md border border-green-500/20 flex items-center gap-2"> | |
| <i className="fa-solid fa-check-circle"></i> | |
| {concept.confidence}% Confidence | |
| </span> | |
| <button className="flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-gradient-to-r from-blue-600 to-blue-700 hover:from-blue-700 hover:to-blue-800 rounded-md transition-all shadow-lg shadow-blue-900/20 hover:shadow-blue-600/30"> | |
| <i className="fa-solid fa-play"></i> | |
| Backtest Strategy | |
| </button> | |
| </div> | |
| </div> | |
| {/* Content */} | |
| <div className="flex-1 overflow-y-auto p-6 scrollbar-thin scrollbar-thumb-gray-700 scrollbar-track-transparent"> | |
| <div className="max-w-7xl mx-auto space-y-6"> | |
| {/* Grid Layout */} | |
| <div className="grid grid-cols-1 lg:grid-cols-3 gap-6"> | |
| {/* Entry Criteria */} | |
| <div className="col-span-1"> | |
| <div className="bg-gray-800 rounded-xl border border-gray-700 overflow-hidden shadow-lg"> | |
| <div className="p-4 border-b border-gray-700 bg-gray-800/80"> | |
| <h3 className="font-semibold text-gray-200 flex items-center gap-2"> | |
| <i className="fa-solid fa-bullseye text-blue-400"></i> | |
| Entry Criteria | |
| </h3> | |
| </div> | |
| <div className="p-5 space-y-6"> | |
| <div className="bg-blue-500/5 p-4 rounded-lg border border-blue-500/20"> | |
| <h4 className="text-sm font-medium text-blue-400 mb-2 flex items-center gap-2"> | |
| <i className="fa-solid fa-arrow-up"></i> | |
| Bullish Entry | |
| </h4> | |
| <p className="text-sm text-gray-300 leading-relaxed">{concept.entry.bullish}</p> | |
| </div> | |
| <div className="bg-red-500/5 p-4 rounded-lg border border-red-500/20"> | |
| <h4 className="text-sm font-medium text-red-400 mb-2 flex items-center gap-2"> | |
| <i className="fa-solid fa-arrow-down"></i> | |
| Bearish Entry | |
| </h4> | |
| <p className="text-sm text-gray-300 leading-relaxed">{concept.entry.bearish}</p> | |
| </div> | |
| </div> | |
| </div> | |
| <div className="bg-gray-800 rounded-xl border border-gray-700 overflow-hidden shadow-lg mt-6"> | |
| <div className="p-4 border-b border-gray-700 bg-gray-800/80"> | |
| <h3 className="font-semibold text-gray-200 flex items-center gap-2"> | |
| <i className="fa-solid fa-stopwatch text-red-400"></i> | |
| Risk Parameters | |
| </h3> | |
| </div> | |
| <div className="p-5 space-y-5"> | |
| <div> | |
| <h4 className="text-sm font-medium text-gray-400 mb-3 flex items-center gap-2"> | |
| <i className="fa-solid fa-shield-halved"></i> | |
| Stop Loss | |
| </h4> | |
| <div className="space-y-3"> | |
| <div className="p-3 bg-red-500/10 rounded-lg border border-red-500/20 flex items-start gap-3"> | |
| <i className="fa-solid fa-arrow-up text-red-400 mt-0.5"></i> | |
| <div> | |
| <p className="text-xs text-red-300 font-bold uppercase">Bullish Protection</p> | |
| <p className="text-sm text-gray-300">{concept.stop_loss.bullish}</p> | |
| </div> | |
| </div> | |
| <div className="p-3 bg-red-500/10 rounded-lg border border-red-500/20 flex items-start gap-3"> | |
| <i className="fa-solid fa-arrow-down text-red-400 mt-0.5"></i> | |
| <div> | |
| <p className="text-xs text-red-300 font-bold uppercase">Bearish Protection</p> | |
| <p className="text-sm text-gray-300">{concept.stop_loss.bearish}</p> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div> | |
| <h4 className="text-sm font-medium text-gray-400 mb-3 flex items-center gap-2"> | |
| <i className="fa-solid fa-flag-checkered"></i> | |
| Take Profits | |
| </h4> | |
| <div className="space-y-2"> | |
| {concept.take_profits.map((tp, idx) => ( | |
| <div key={idx} className="flex items-start gap-3 p-2 rounded-lg hover:bg-gray-700/50 transition-colors"> | |
| <span className="flex-shrink-0 w-6 h-6 rounded-full bg-green-500/20 text-green-400 flex items-center justify-center text-xs font-bold border border-green-500/30"> | |
| {idx + 1} | |
| </span> | |
| <span className="text-sm text-gray-300">{tp.description}</span> | |
| </div> | |
| ))} | |
| </div> | |
| </div> | |
| <div className="pt-4 border-t border-gray-700"> | |
| <h4 className="text-sm font-medium text-gray-400 mb-2 flex items-center gap-2"> | |
| <i className="fa-solid fa-xmark"></i> | |
| Invalidation | |
| </h4> | |
| <p className="text-sm text-gray-300 bg-gray-700/30 p-3 rounded-lg border border-gray-600/50 italic"> | |
| {concept.invalidation} | |
| </p> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| {/* Confluence Factors */} | |
| <div className="col-span-1"> | |
| <div className="bg-gray-800 rounded-xl border border-gray-700 overflow-hidden shadow-lg"> | |
| <div className="p-4 border-b border-gray-700 bg-gray-800/80"> | |
| <h3 className="font-semibold text-gray-200 flex items-center gap-2"> | |
| <i className="fa-solid fa-layer-group text-purple-400"></i> | |
| Confluence Factors | |
| </h3> | |
| </div> | |
| <div className="p-5"> | |
| <div className="space-y-3"> | |
| {concept.confluence_factors.map((factor, idx) => ( | |
| <div key={idx} className="flex items-start gap-3 p-4 bg-gradient-to-r from-gray-800 to-gray-700/50 rounded-lg border border-purple-500/20 hover:border-purple-500/40 transition-all group"> | |
| <div className="mt-0.5 w-6 h-6 rounded-full bg-purple-500/20 text-purple-400 flex items-center justify-center text-xs font-bold border border-purple-500/30 group-hover:scale-110 transition-transform"> | |
| {idx + 1} | |
| </div> | |
| <p className="text-sm text-gray-300 leading-relaxed">{factor}</p> | |
| </div> | |
| ))} | |
| </div> | |
| </div> | |
| </div> | |
| <div className="bg-gray-800 rounded-xl border border-gray-700 overflow-hidden shadow-lg mt-6"> | |
| <div className="p-4 border-b border-gray-700 bg-gray-800/80"> | |
| <h3 className="font-semibold text-gray-200 flex items-center gap-2"> | |
| <i className="fa-solid fa-chart-pie text-green-400"></i> | |
| Confidence Boosters | |
| </h3> | |
| </div> | |
| <div className="p-5 space-y-5"> | |
| <div className="p-4 bg-green-500/10 rounded-lg border border-green-500/20 relative overflow-hidden"> | |
| <div className="absolute top-0 right-0 p-2 opacity-10"> | |
| <i className="fa-solid fa-check-double text-4xl"></i> | |
| </div> | |
| <p className="text-sm text-green-400 font-medium leading-relaxed">{concept.confidence_boost}</p> | |
| </div> | |
| <div> | |
| <h4 className="text-sm font-medium text-gray-400 mb-2 flex items-center gap-2"> | |
| <i className="fa-solid fa-lightbulb"></i> | |
| Expert Notes | |
| </h4> | |
| <p className="text-sm text-gray-300 leading-relaxed">{concept.notes}</p> | |
| </div> | |
| </div> | |
| </div> | |
| <div className="bg-gray-800 rounded-xl border border-gray-700 overflow-hidden shadow-lg mt-6"> | |
| <div className="p-4 border-b border-gray-700 bg-gray-800/80"> | |
| <h3 className="font-semibold text-gray-200 flex items-center gap-2"> | |
| <i className="fa-solid fa-list-check text-blue-400"></i> | |
| Conditions Checklist | |
| </h3> | |
| </div> | |
| <div className="p-5"> | |
| <div className="grid grid-cols-1 md:grid-cols-2 gap-4"> | |
| {concept.conditions.map((condition, idx) => ( | |
| <div key={idx} className="flex items-start gap-3 p-3 bg-gray-700/30 rounded-lg border border-gray-600/30 hover:border-blue-500/30 transition-colors"> | |
| <div className="mt-0.5 w-5 h-5 rounded-full bg-blue-500/20 text-blue-400 flex items-center justify-center text-xs font-bold border border-blue-500/30"> | |
| {idx + 1} | |
| </div> | |
| <div> | |
| <h4 className="text-xs font-medium text-gray-300 mb-1 uppercase tracking-wide">{condition.type.replace('_', ' ')}</h4> | |
| <p className="text-sm text-gray-400">{condition.description}</p> | |
| </div> | |
| </div> | |
| ))} | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| {/* Timing & Media */} | |
| <div className="col-span-1"> | |
| <div className="bg-gray-800 rounded-xl border border-gray-700 overflow-hidden shadow-lg"> | |
| <div className="p-4 border-b border-gray-700 bg-gray-800/80"> | |
| <h3 className="font-semibold text-gray-200 flex items-center gap-2"> | |
| <i className="fa-solid fa-clock text-orange-400"></i> | |
| Timing Examples | |
| </h3> | |
| </div> | |
| <div className="p-5"> | |
| <div className="space-y-3"> | |
| {concept.timestamp_examples.map((example, idx) => { | |
| const [session, time] = example.split(' - '); | |
| return ( | |
| <div key={idx} className="flex items-start gap-3 p-3 bg-gradient-to-r from-gray-800 to-orange-900/20 rounded-lg border border-orange-500/20 hover:border-orange-500/40 transition-all group"> | |
| <div className="mt-0.5 w-8 h-8 rounded-full bg-orange-500/20 text-orange-400 flex items-center justify-center text-xs font-bold border border-orange-500/30 group-hover:scale-110 transition-transform"> | |
| {idx + 1} | |
| </div> | |
| <div> | |
| <span className="inline-block px-2 py-0.5 text-[10px] font-bold text-orange-300 bg-orange-500/20 rounded mb-1 border border-orange-500/20"> | |
| {session} | |
| </span> | |
| <p className="text-sm text-gray-300">{time}</p> | |
| </div> | |
| </div> | |
| ); | |
| })} | |
| </div> | |
| </div> | |
| </div> | |
| <div className="bg-gray-800 rounded-xl border border-gray-700 overflow-hidden shadow-lg mt-6"> | |
| <div className="p-4 border-b border-gray-700 bg-gray-800/80"> | |
| <h3 className="font-semibold text-gray-200 flex items-center gap-2"> | |
| <i className="fa-solid fa-video text-pink-400"></i> | |
| Video Source | |
| </h3> | |
| </div> | |
| <div className="p-5 space-y-4"> | |
| <div className="p-4 bg-pink-500/10 rounded-lg border border-pink-500/20 relative overflow-hidden hover:bg-pink-500/15 transition-colors"> | |
| <div className="absolute top-0 right-0 p-2 opacity-10"> | |
| <i className="fa-brands fa-youtube text-4xl"></i> | |
| </div> | |
| <h4 className="text-sm font-medium text-gray-300 mb-3 line-clamp-2">{concept.video_title}</h4> | |
| <a | |
| href={`https://www.youtube.com/watch?v=${concept.video_id}`} | |
| target="_blank" | |
| rel="noopener noreferrer" | |
| className="flex items-center gap-3 text-sm text-pink-400 hover:text-pink-300 font-medium transition-colors group" | |
| > | |
| <div className="w-8 h-8 rounded-full bg-pink-600 flex items-center justify-center group-hover:scale-110 transition-transform"> | |
| <i className="fa-solid fa-play"></i> | |
| </div> | |
| Watch Full Analysis | |
| <i className="fa-solid fa-external-link-alt text-[10px]"></i> | |
| </a> | |
| </div> | |
| <div className="bg-gray-700/30 rounded-lg p-4 border border-gray-600/50"> | |
| <h4 className="text-xs font-medium text-gray-400 uppercase mb-3">Resource Details</h4> | |
| <div className="flex justify-between text-sm"> | |
| <span className="text-gray-500">Length</span> | |
| <span className="text-gray-300 font-mono">12:45</span> | |
| </div> | |
| <div className="flex justify-between text-sm mt-2"> | |
| <span className="text-gray-500">Speaker</span> | |
| <span className="text-gray-300">ICT Master</span> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div className="bg-gray-800 rounded-xl border border-gray-700 overflow-hidden shadow-lg mt-6"> | |
| <div className="p-4 border-b border-gray-700 bg-gray-800/80"> | |
| <h3 className="font-semibold text-gray-200 flex items-center gap-2"> | |
| <i className="fa-solid fa-robot text-blue-400"></i> | |
| AI Analysis | |
| </h3> | |
| </div> | |
| <div className="p-5"> | |
| <div className="p-4 bg-blue-500/5 rounded-lg border border-blue-500/20"> | |
| <p className="text-sm text-gray-300 leading-relaxed"> | |
| AI Confidence Score: <span className="text-blue-400 font-bold">{concept.confidence}%</span>. Based on current market structure, this concept shows strong alignment with institutional order flow patterns. Recommended for high-probability setups. | |
| </p> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| ); | |
| }; | |
| const getIconForType = (type) => { | |
| const icons = { | |
| core_concept: 'fa-book', | |
| supporting_concept: 'fa-bookmark', | |
| strategy: 'fa-chart-line', | |
| risk_management: 'fa-shield-halved', | |
| session_analysis: 'fa-clock' | |
| }; | |
| return icons[type] || 'fa-file'; | |
| }; | |
| export default ConceptDetail; |