SET ":view" = COALESCE(:content, '') <> '';
SELECT 'button' AS component;
SELECT 'Open' AS title
, 1 AS width
, '/goto.sql?action=open' AS link
;
SELECT 'New' AS title
, 1 AS width
, 'gray-500' AS color
, '/goto.sql' AS link
;

SELECT 'form' AS component
, '/goto.sql' AS action
, 'Shrtn It!' AS validate
, :tabler_color AS validate_color
, 'post' AS method
WHERE NOT :view
;
SELECT 'action' AS name
, '' AS label
, 'hidden' AS type
, 'Shrtn It!' AS value
WHERE NOT :view
;
SELECT 'content' AS name
, '' AS label
, 'input' AS type
, :content AS value
, 'Paste URL here...' AS placeholder
WHERE NOT :view
;

SELECT 'dynamic' AS component, sqlpage.run_sql('goto/preview.sql') AS properties
WHERE :content <> ''
;