fix: loadCategories error handling and invalid Tailwind opacity fractions
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -11,8 +11,8 @@ function TemplateSkeleton() {
|
|||||||
return (
|
return (
|
||||||
<div className="px-4 py-3 rounded-xl border border-border animate-pulse">
|
<div className="px-4 py-3 rounded-xl border border-border animate-pulse">
|
||||||
<div className="flex justify-between mb-2">
|
<div className="flex justify-between mb-2">
|
||||||
<div className="h-4 w-2/3 bg-white/8 rounded" />
|
<div className="h-4 w-2/3 bg-white/10 rounded" />
|
||||||
<div className="h-4 w-14 bg-white/8 rounded" />
|
<div className="h-4 w-14 bg-white/10 rounded" />
|
||||||
</div>
|
</div>
|
||||||
<div className="h-3 w-full bg-white/5 rounded mb-1" />
|
<div className="h-3 w-full bg-white/5 rounded mb-1" />
|
||||||
<div className="h-3 w-3/4 bg-white/5 rounded" />
|
<div className="h-3 w-3/4 bg-white/5 rounded" />
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export function TemplateCard({ template }: Props) {
|
|||||||
onClick={() => selectTemplate(template.id)}
|
onClick={() => selectTemplate(template.id)}
|
||||||
className={cn(
|
className={cn(
|
||||||
'w-full text-left px-4 py-3 rounded-xl border transition-all',
|
'w-full text-left px-4 py-3 rounded-xl border transition-all',
|
||||||
'hover:border-white/12 hover:bg-white/4',
|
'hover:border-[rgba(255,255,255,0.12)] hover:bg-white/5',
|
||||||
isActive
|
isActive
|
||||||
? 'bg-primary/10 border-primary/30 border-l-[3px] border-l-primary'
|
? 'bg-primary/10 border-primary/30 border-l-[3px] border-l-primary'
|
||||||
: 'border-border bg-transparent'
|
: 'border-border bg-transparent'
|
||||||
|
|||||||
@@ -59,8 +59,12 @@ export const useScriptGeneratorStore = create<ScriptGeneratorState>()((set, get)
|
|||||||
generateError: null,
|
generateError: null,
|
||||||
|
|
||||||
loadCategories: async () => {
|
loadCategories: async () => {
|
||||||
const categories = await scriptsApi.getCategories()
|
try {
|
||||||
set({ categories })
|
const categories = await scriptsApi.getCategories()
|
||||||
|
set({ categories })
|
||||||
|
} catch {
|
||||||
|
// silently ignore — categories remain empty, UI degrades gracefully
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
loadTemplates: async () => {
|
loadTemplates: async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user