mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-05-01 02:57:41 +03:00
Move to separate component
This commit is contained in:
parent
93a3cf8fb9
commit
91ac4137dc
@ -37,6 +37,18 @@ export default function ModelSelectionView({
|
|||||||
return (
|
return (
|
||||||
<div className="flex size-full gap-2 p-2">
|
<div className="flex size-full gap-2 p-2">
|
||||||
{classificationConfigs.map((config) => (
|
{classificationConfigs.map((config) => (
|
||||||
|
<ModelCard config={config} onClick={() => onClick(config)} />
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
type ModelCardProps = {
|
||||||
|
config: CustomClassificationModelConfig;
|
||||||
|
onClick: () => void;
|
||||||
|
};
|
||||||
|
function ModelCard({ config, onClick }: ModelCardProps) {
|
||||||
|
return (
|
||||||
<div
|
<div
|
||||||
key={config.name}
|
key={config.name}
|
||||||
className={cn(
|
className={cn(
|
||||||
@ -44,7 +56,7 @@ export default function ModelSelectionView({
|
|||||||
"outline-transparent duration-500",
|
"outline-transparent duration-500",
|
||||||
isMobile && "w-full",
|
isMobile && "w-full",
|
||||||
)}
|
)}
|
||||||
onClick={() => onClick(config)}
|
onClick={() => onClick()}
|
||||||
onContextMenu={() => {
|
onContextMenu={() => {
|
||||||
// e.stopPropagation();
|
// e.stopPropagation();
|
||||||
// e.preventDefault();
|
// e.preventDefault();
|
||||||
@ -57,7 +69,5 @@ export default function ModelSelectionView({
|
|||||||
Classification)
|
Classification)
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user