Sprint 4 — Etapa 7B completada.
Some checks failed
/ Deploy to Cloudflare Pages (push) Has been cancelled

This commit is contained in:
2026-06-19 00:20:27 -03:00
parent 892b8b3bc7
commit c738bc5489
6 changed files with 247 additions and 11 deletions

View File

@@ -11,7 +11,7 @@ import { Switch } from '@/components/ui/switch'
import { Separator } from '@/components/ui/separator'
import { useProcessStore } from '@/store/process-store'
import { useAuth } from '@/auth/AuthContext'
import { formatCurrency } from '@/lib/format'
import { formatCurrency, formatCostPerHour } from '@/lib/format'
import type { Activity } from '@/domain/types'
interface ActivityPanelProps {
@@ -254,7 +254,7 @@ export function ActivityPanel({ selectedElementId }: ActivityPanelProps) {
<div className="flex items-center justify-between">
<div>
<p className="text-xs font-medium text-slate-700">{resource.name}</p>
<p className="text-xs text-slate-400 font-mono">{formatCurrency(resource.costPerHour)}/h</p>
<p className="text-xs text-slate-400 font-mono">{formatCostPerHour(resource.costPerHour)}/h</p>
</div>
<Button
variant="ghost"
@@ -318,7 +318,7 @@ export function ActivityPanel({ selectedElementId }: ActivityPanelProps) {
<SelectContent>
{availableResources.map((r) => (
<SelectItem key={r.id} value={r.id} className="text-xs">
{r.name} {formatCurrency(r.costPerHour)}/h
{r.name} {formatCostPerHour(r.costPerHour)}/h
</SelectItem>
))}
</SelectContent>

View File

@@ -5,13 +5,13 @@ import { Button } from '@/components/ui/button'
import { ScrollArea } from '@/components/ui/scroll-area'
import { useProcessStore } from '@/store/process-store'
import { useAuth } from '@/auth/AuthContext'
import { formatCurrency } from '@/lib/format'
import { formatCostPerHour } from '@/lib/format'
import { RESOURCE_TYPE_LABELS, ResourceTypeAvatar } from '@/features/resources/resource-display'
import { ResourceFormSheet } from '@/features/resources/ResourceFormSheet'
import type { Resource } from '@/domain/types'
export function ResourcesPanel() {
const { activities, resources, addResource } = useProcessStore()
const { currentProcess, activities, resources, addResource } = useProcessStore()
const { user } = useAuth()
const navigate = useNavigate()
const [sheetOpen, setSheetOpen] = useState(false)
@@ -65,7 +65,7 @@ export function ResourcesPanel() {
<div className="min-w-0 flex-1">
<div className="flex items-center justify-between gap-2">
<p className="text-xs font-medium text-slate-800 truncate">{resource.name}</p>
<p className="text-xs text-slate-500 font-mono shrink-0">{formatCurrency(resource.costPerHour)}/h</p>
<p className="text-xs text-slate-500 font-mono shrink-0">{formatCostPerHour(resource.costPerHour)}/h</p>
</div>
<p className="text-[11px] text-slate-400 mt-0.5">
{RESOURCE_TYPE_LABELS[resource.type]} · {usageCount(resource.id)} actividad{usageCount(resource.id) !== 1 ? 'es' : ''}
@@ -84,7 +84,10 @@ export function ResourcesPanel() {
<Button
variant="outline"
className="w-full h-8 text-xs gap-1.5"
onClick={() => navigate({ to: '/recursos' })}
onClick={() => navigate({
to: '/recursos',
search: currentProcess ? { fromProcess: currentProcess.id } : undefined,
})}
>
<ExternalLink className="h-3.5 w-3.5" />
Ver catálogo completo